Belle II Software  release-08-01-10
Trainer Class Reference

Public Member Functions

def __init__ (self, model, data_set, log_dir=None, save_name=None, monitoring_size=10000)
 
def train_model (self)
 

Public Attributes

 model
 model
 
 data_set
 dataset
 
 monitoring_size
 monitoring size
 
 log_dir
 log dir
 
 termination_criterion
 termination criterion
 
 current_epoch
 initialise current epoch
 
 best_epoch
 initialise best epoch
 
 save_name
 set the path and name for saving the weightfiles
 
 train_monitor
 train_monitor
 
 valid_monitor
 test monitor
 
 train_writer
 tf.summary.writer for training
 
 valid_writer
 tf.summary.writer for validation
 
 optimizer
 set optimizer for this epoch
 

Private Member Functions

def _prepare_monitoring (self)
 
def _prepare_tensorboard (self, log_dir)
 
def _train_epoch (self, current_epoch)
 
def _save_best_state (self, cross_entropy)
 
def _closing_ops (self)
 

Private Attributes

 _time
 current time
 

Detailed Description

handling the training of the network model

Definition at line 450 of file tensorflow_dnn_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  model,
  data_set,
  log_dir = None,
  save_name = None,
  monitoring_size = 10000 
)
class to train a predefined model
:param model: DefaultModel obj
:param data_set: TFData obj
:param log_dir: str, directory name of tensorboard logging
:param save_name: str, path and name for saving the weightfiles
:param monitoring_size: int, number of events of training fraction used for monitoring

Definition at line 455 of file tensorflow_dnn_model.py.

Member Function Documentation

◆ _closing_ops()

def _closing_ops (   self)
private
closing operations

Definition at line 625 of file tensorflow_dnn_model.py.

◆ _prepare_monitoring()

def _prepare_monitoring (   self)
private
checking dataset sizes for evaluation. These samples are used after each epoch to collect
summary statistics and test early stopping criteria.

Definition at line 508 of file tensorflow_dnn_model.py.

◆ _prepare_tensorboard()

def _prepare_tensorboard (   self,
  log_dir 
)
private
prepare tensorboard

Definition at line 524 of file tensorflow_dnn_model.py.

◆ _save_best_state()

def _save_best_state (   self,
  cross_entropy 
)
private
save model as a checkpoint only if a global minimum is reached on validation sample
:return:

Definition at line 607 of file tensorflow_dnn_model.py.

◆ _train_epoch()

def _train_epoch (   self,
  current_epoch 
)
private
train epoch

Definition at line 538 of file tensorflow_dnn_model.py.

◆ train_model()

def train_model (   self)
train model

Definition at line 634 of file tensorflow_dnn_model.py.


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