chipiron.scripts.learn_nn_supervised package
Submodules
chipiron.scripts.learn_nn_supervised.learn_nn_from_supervised_datasets module
This script learns a neural network (NN) from a supervised dataset of board and evaluation pairs.
The script takes care of setting up the data loader from the evaluation files, creating the NN, and running the learning process.
Usage: - Instantiate the LearnNNScript class with a base_script object. - Call the run() method to start the learning process. - Call the terminate() method to finish the script.
Example
base_script = Script() learn_script = LearnNNScript(base_script) learn_script.run() learn_script.terminate()
- class chipiron.scripts.learn_nn_supervised.learn_nn_from_supervised_datasets.LearnNNScript(base_script: Script[LearnNNScriptArgs])[source]
Bases:
objectScript that learns a NN from a supervised dataset pairs of board and evaluation
- Parameters:
base_script (Script) – The base script object.
- args
The script arguments.
- Type:
- args: LearnNNScriptArgs
- args_dataclass_name
alias of
LearnNNScriptArgs
- base_experiment_output_folder = 'chipiron/scripts/learn_nn_supervised/learn_nn_supervised_outputs'
- base_script: Script[LearnNNScriptArgs]
- nn_board_evaluator: NNBoardEvaluator
- run() None[source]
Running the learning of the NN.
This method performs the training of the neural network. It iterates over the training data batches, computes the training loss, and updates the learning rate if necessary. It also prints the training loss and learning rate at regular intervals, and saves the learning process.
- Returns:
None
- saving_folder: str | PathLike[str]
- class chipiron.scripts.learn_nn_supervised.learn_nn_from_supervised_datasets.LearnNNScriptArgs(base_script_args: ~chipiron.scripts.script_args.BaseScriptArgs = <factory>, nn_trainer_args: ~chipiron.learningprocesses.nn_trainer.factory.NNTrainerArgs = <factory>, dataset_args: ~chipiron.players.boardevaluators.datasets.datasets.DataSetArgs = <factory>)[source]
Bases:
objectRepresents the arguments for the LearnNNScript.
- nn_trainer_args
The arguments for the NNTrainer.
- Type:
- base_script_args: BaseScriptArgs
- dataset_args: DataSetArgs
- nn_trainer_args: NNTrainerArgs