Skip to content

Commit

Permalink
feat(cli): add --lr for setting adam learning rate
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Jan 25, 2020
1 parent ed662e3 commit 427352f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/mathy_python/mathy/agents/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Config:
init_model_from: Optional[str] = None
train: bool = False
verbose: bool = False
lr: float = 3e-4
lr: float = 1e-3
max_eps: int = 15000
# How often to write histograms to tensorboard (in training steps)
summary_interval: int = 100
Expand Down
10 changes: 10 additions & 0 deletions libraries/mathy_python/mathy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ def cli_print_problems(environment: str, difficulty: str, number: int):
type=int,
help="Number of dimensions to use for math vectors and model dimensions",
)
@click.option(
"lr",
"--lr",
default=3e-4,
type=float,
help="The learning rate to use with adam optimizer",
)
@click.option(
"embeddings",
"--embeddings",
Expand Down Expand Up @@ -220,6 +227,7 @@ def cli_train(
profile: bool,
episodes: int,
mcts_sims: int,
lr: float,
show: bool,
verbose: bool,
training_iterations: int,
Expand Down Expand Up @@ -253,6 +261,7 @@ def cli_train(
lstm_units=rnn,
units=units,
embedding_units=embeddings,
lr=lr,
mcts_sims=mcts_sims,
model_dir=folder,
init_model_from=transfer,
Expand All @@ -274,6 +283,7 @@ def cli_train(
verbose=verbose,
difficulty=difficulty,
topics=topics_list,
lr=lr,
lstm_units=rnn,
units=units,
embedding_units=embeddings,
Expand Down

0 comments on commit 427352f

Please sign in to comment.