--lr

🦉 AthenaAI is an AI-powered ensemble machine-learning trading bot for PocketOption, built on BinaryOptionsToolsV2Get it on GitLab
💬 Need help? Join the Chipa Discord · ⚡ Go no-code with ChipaEditor

Learning rate for the neural model’s optimizer.

Typefloat
Default0.001 (1e-3)
Maps toTrainerConfig.nn_lr
Read intrain.pysrc/training/trainer.py (Trainer._train_nn()) → src/training/torch_model.py (TorchMLPClassifier.fit())

What it does

_train_nn() passes nn_lr to TorchMLPClassifier(lr=...). In fit() it becomes the learning rate of the AdamW optimizer:

opt = torch.optim.AdamW(net.parameters(), lr=self.lr, weight_decay=self.weight_decay)

The learning rate is constant for the whole run — there is no scheduler, warmup, or decay. Weight decay is fixed at 1e-5 and is not CLI-exposed. Inputs are already standardized (the trainer scales features with the ensemble’s fitted scaler before calling fit()), so the default 1e-3 is a well-conditioned starting point.

Choosing a value

  • 1e-3 is the standard Adam/AdamW default and works well here.
  • If the logged per-epoch loss oscillates or diverges, lower it (e.g. 5e-4 or 1e-4).
  • If loss is still steadily falling at the final epoch, either raise --epochs or nudge the LR up slightly.
  • The training guide’s “squeeze more out” recipe pairs a lower LR with more epochs and a bigger network: --epochs 60 --hidden 256,128,64 --lr 5e-4.
  • Since there is no LR schedule, err on the smaller side for long runs.

Examples

python train.py --lr 5e-4 --epochs 60
python train.py --lr 0.002 --batch-size 4096

Interactions

  • --epochs — lower LR generally needs more epochs.
  • --batch-size — larger batches produce less noisy gradients and can tolerate higher LR.
  • --no-nn — makes this flag a no-op.

See also

💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.