Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating hyper-parameters on MLP Pytorch #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mlp_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ def sample_discrete(probs, coinf):
train_tokens = [char_to_token[c] for c in open('data/train.txt', 'r').read()]

# create the model
context_length = 3 # if 3 tokens predict the 4th, this is a 4-gram model
embedding_size = 48
hidden_size = 512
context_length = 4 # if 3 tokens predict the 4th, this is a 4-gram model
embedding_size = 64
hidden_size = 1024
init_rng = RNG(1337)
# these two classes both produce the exact same results. One uses nn.Module the other doesn't.
model = MLPRaw(vocab_size, context_length, embedding_size, hidden_size, init_rng)
# model = MLP(vocab_size, context_length, embedding_size, hidden_size, init_rng)

# create the optimizer
learning_rate = 7e-4
learning_rate = 0.01
optimizer = torch.optim.AdamW(model.parameters(), lr=learning_rate, weight_decay=1e-4)

# training loop
Expand Down