https://mooseframework.inl.gov
Public Attributes | List of all members
Moose::LibtorchTrainingOptions Struct Reference

A struct containing necessary information for training neural networks. More...

#include <LibtorchArtificialNeuralNetTrainer.h>

Public Attributes

MooseEnum optimizer_type = MooseEnum("adam=0 adagrad=1 rmsprop=2 sgd=3", "adam")
 The type of optimizer we want to use for training, adam is the default due to its robustness and fast convergence. More...
 
unsigned int num_epochs = 1
 Number of iterations we want to perform on the whole dataset. More...
 
unsigned int num_batches = 1
 Number of batches we want to split the dataset into. More...
 
bool print_loss = false
 If we want to print additional information during training. More...
 
unsigned int print_epoch_loss = 1
 The frequency of training loss print to console. More...
 
Real rel_loss_tol = 1e-12
 The relative loss tolerance where the training shall stop. More...
 
Real learning_rate = 1e-3
 The learning rate for the optimizers. More...
 
unsigned int parallel_processes = 1
 The number of allowed parallel processes. More...
 
bool allow_duplicates = false
 Parameter for sampling. More...
 

Detailed Description

A struct containing necessary information for training neural networks.

This is an easy way to pass multiple parameters to the neural networks and follows the design of multiple libtorch classes.

Definition at line 27 of file LibtorchArtificialNeuralNetTrainer.h.

Member Data Documentation

◆ allow_duplicates

bool Moose::LibtorchTrainingOptions::allow_duplicates = false

Parameter for sampling.

This actually allows random samplers to use the same sample multiple times. Sometimes comes in handy when only a few of them are needed to fill up empty slots in the last batch. NOTE: This may introduce a considerable BIAS!

Definition at line 51 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().

◆ learning_rate

Real Moose::LibtorchTrainingOptions::learning_rate = 1e-3

The learning rate for the optimizers.

Definition at line 43 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::createOptimizer().

◆ num_batches

unsigned int Moose::LibtorchTrainingOptions::num_batches = 1

Number of batches we want to split the dataset into.

Definition at line 35 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().

◆ num_epochs

unsigned int Moose::LibtorchTrainingOptions::num_epochs = 1

Number of iterations we want to perform on the whole dataset.

Definition at line 33 of file LibtorchArtificialNeuralNetTrainer.h.

◆ optimizer_type

MooseEnum Moose::LibtorchTrainingOptions::optimizer_type = MooseEnum("adam=0 adagrad=1 rmsprop=2 sgd=3", "adam")

The type of optimizer we want to use for training, adam is the default due to its robustness and fast convergence.

Definition at line 31 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::createOptimizer().

◆ parallel_processes

unsigned int Moose::LibtorchTrainingOptions::parallel_processes = 1

The number of allowed parallel processes.

It is necessary to bound it because the user may want to run simulations with more processors than data samples which leads to segmentation faults is a process remains with no sample

Definition at line 47 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().

◆ print_epoch_loss

unsigned int Moose::LibtorchTrainingOptions::print_epoch_loss = 1

The frequency of training loss print to console.

Definition at line 39 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().

◆ print_loss

bool Moose::LibtorchTrainingOptions::print_loss = false

If we want to print additional information during training.

Definition at line 37 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().

◆ rel_loss_tol

Real Moose::LibtorchTrainingOptions::rel_loss_tol = 1e-12

The relative loss tolerance where the training shall stop.

Definition at line 41 of file LibtorchArtificialNeuralNetTrainer.h.

Referenced by Moose::LibtorchArtificialNeuralNetTrainer< SamplerType >::train().


The documentation for this struct was generated from the following file: