Belle II Software  release-08-01-10
DefaultModel Class Reference
Inheritance diagram for DefaultModel:
Collaboration diagram for DefaultModel:

Public Member Functions

def __init__ (self, mlp, mom_init=.9, mom_max=.99, mom_epochs=200, lr_init=.05, lr_min=1e-6, lr_dec_rate=.976, stop_epochs=10, min_epochs=200, max_epochs=1000, wd_coeffs=None, change_optimizer=None, staircase=True, smooth_cross_entropy=False)
 
def initialize (self, data_set)
 
def __call__ (self, x)
 
def get_optimizer (self, epoch=0)
 
def loss (self, predict_y, true_y)
 

Public Attributes

 mlp
 mlp net
 
 wd_coeffs
 weight decay coefficients
 
 global_step
 global step
 
 c_mom_init
 initial momentum
 
 c_mom_max
 maximum momentum
 
 c_mom_epochs
 momentum epochs
 
 c_mom_dec_rate
 momentum decay rate
 
 c_lr_init
 initial learning rate
 
 c_lr_min
 minimum learning rate
 
 c_lr_dec_rate
 learning rate decay rate
 
 c_stop_epochs
 number of epochs without improvement for early termination
 
 c_staircase
 use staircase
 
 batches_per_epoch
 batches per epoch unknown. More...
 
 optimizers
 define multiple optimizers
 
 optimizer_change_epochs
 used opimizers
 
 min_epochs
 min epochs
 
 max_epochs
 max epochs
 
 termination_criterion
 termination criterion
 
 recent_params
 recent params
 
 best_value
 the best value will be set a default start value, then updated with the termination criterion
 
 step_countdown
 step countdown
 
 smooth_cross_entropy
 True for a small epsilon addition, false for a clipped network output.
 
 is_initialized
 check if initialized
 

Private Member Functions

def _default_termination_criterion (self, monitoring_param, epoch, prop_dec=1e-5)
 
def _get_learning_rate (self)
 
def _get_momentum (self)
 
def _set_optimizer (self)
 

Detailed Description

define the default model

Definition at line 198 of file tensorflow_dnn_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  mlp,
  mom_init = .9,
  mom_max = .99,
  mom_epochs = 200,
  lr_init = .05,
  lr_min = 1e-6,
  lr_dec_rate = .976,
  stop_epochs = 10,
  min_epochs = 200,
  max_epochs = 1000,
  wd_coeffs = None,
  change_optimizer = None,
  staircase = True,
  smooth_cross_entropy = False 
)
initialization function
:param mlp: network model.
:param mom_init: initial momentum
:param mom_max: maximum momentum
:param mom_epochs: momentum epochs
:param lr_init: initial learning rate
:param lr_min: minimum learning rate
:param lr_dec_rate: learning rate decay factor
:param stop_epochs: number of epochs without improvement required for early termination
:param min_epochs: minimum number of epochs for training
:param max_epochs: maximum number of epochs for traning
:param wd_coeffs: weight decay coefficients. If not None must have one per mlp layer.
:param change_optimizer:
:param staircaise:
"param smooth_cross_entropy:

Definition at line 203 of file tensorflow_dnn_model.py.

Member Function Documentation

◆ __call__()

def __call__ (   self,
  x 
)
Call the mlp

Definition at line 336 of file tensorflow_dnn_model.py.

◆ _default_termination_criterion()

def _default_termination_criterion (   self,
  monitoring_param,
  epoch,
  prop_dec = 1e-5 
)
private
early stopping criterion

:param monitoring_param: the parameter to monitor for early termination
:param epoch: the current epoch
:param prop_dec:
:return:

Definition at line 342 of file tensorflow_dnn_model.py.

◆ _get_learning_rate()

def _get_learning_rate (   self)
private
Returns the learning rate at the current global step.

Definition at line 367 of file tensorflow_dnn_model.py.

◆ _get_momentum()

def _get_momentum (   self)
private
returns the momentum at the current global step.

Definition at line 376 of file tensorflow_dnn_model.py.

◆ _set_optimizer()

def _set_optimizer (   self)
private
set optimizers

Definition at line 391 of file tensorflow_dnn_model.py.

◆ get_optimizer()

def get_optimizer (   self,
  epoch = 0 
)
get the optimizer. If multiple optimizers are booked gets the one appropriate for the epoch.

:param epoch: current epoch.

Definition at line 400 of file tensorflow_dnn_model.py.

◆ initialize()

def initialize (   self,
  data_set 
)
Finalises intitialization based of data_set specific information (number of batches per epoch)

Definition at line 316 of file tensorflow_dnn_model.py.

◆ loss()

def loss (   self,
  predict_y,
  true_y 
)
calculate the loss

:param predict_y: predicted labels
:param true_y: true labels

Definition at line 418 of file tensorflow_dnn_model.py.

Member Data Documentation

◆ batches_per_epoch

batches_per_epoch

batches per epoch unknown.

needs to be set with initialize

Definition at line 276 of file tensorflow_dnn_model.py.


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