|
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) |
|
define the default model
Definition at line 198 of file tensorflow_dnn_model.py.
◆ __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.
◆ __call__()
◆ _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 |
◆ _get_momentum()
def _get_momentum |
( |
|
self | ) |
|
|
private |
◆ _set_optimizer()
def _set_optimizer |
( |
|
self | ) |
|
|
private |
◆ 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.
◆ batches_per_epoch
The documentation for this class was generated from the following file: