Skip to content

Commit

Permalink
Rename MLP to LogisticRegression (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
achyudh authored and Ashutosh-Adhikari committed Nov 2, 2019
1 parent d2dba11 commit c602b82
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
File renamed without changes.
7 changes: 3 additions & 4 deletions models/mlp/__main__.py → models/lr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
from datasets.bow_processors.imdb_processor import IMDBProcessor
from datasets.bow_processors.reuters_processor import ReutersProcessor
from datasets.bow_processors.yelp2014_processor import Yelp2014Processor
from models.mlp.args import get_args
from models.mlp.model import MLP
from models.lr.args import get_args
from models.lr.model import LogisticRegression

# String templates for logging results

LOG_HEADER = 'Split Dev/Acc. Dev/Pr. Dev/Re. Dev/F1 Dev/Loss'
LOG_TEMPLATE = ' '.join('{:>5s},{:>9.4f},{:>8.4f},{:8.4f},{:8.4f},{:10.4f}'.split(','))

Expand Down Expand Up @@ -72,7 +71,7 @@ def evaluate_split(model, vectorizer, processor, args, split='dev'):
save_path = os.path.join(args.save_path, dataset_map[args.dataset].NAME)
os.makedirs(save_path, exist_ok=True)

model = MLP(args)
model = LogisticRegression(args)
model.to(device)

if n_gpu > 1:
Expand Down
2 changes: 1 addition & 1 deletion models/mlp/args.py → models/lr/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_args():
parser.add_argument('--epoch-decay', type=int, default=15)
parser.add_argument('--weight-decay', type=float, default=0)

parser.add_argument('--save-path', type=str, default=os.path.join('model_checkpoints', 'mlp'))
parser.add_argument('--save-path', type=str, default=os.path.join('model_checkpoints', 'lr'))
parser.add_argument('--resume-snapshot', type=str)
parser.add_argument('--trained-model', type=str)

Expand Down
2 changes: 1 addition & 1 deletion models/mlp/model.py → models/lr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch.nn as nn


class MLP(nn.Module):
class LogisticRegression(nn.Module):

def __init__(self, config):
super().__init__()
Expand Down

0 comments on commit c602b82

Please sign in to comment.