twodlearn.optim module¶
-
class
twodlearn.optim.
EarlyStopping
(monitor, var_list, logger_path, session, check_func=None, options=None)[source]¶ Bases:
twodlearn.core.common.TdlObject
-
add_checkpoint
[source]¶ Decorator used to specify methods that have a set of local variables.
These methods consist of an initialization method (speficied with the function given to the decorator) and an execute method.
-
check_lower
[source]¶ Decorator used to specify methods that have a set of local variables.
These methods consist of an initialization method (speficied with the function given to the decorator) and an execute method.
-
-
class
twodlearn.optim.
EarlyStoppingV2
(optimizer, objective, minimize=True)[source]¶
-
class
twodlearn.optim.
OptimizationManager
(session, optimizer=None, step_op=None, monitor_manager=None, n_logging=100, saver=None, options=None, optimizer_op=None)[source]¶ Bases:
object
Performs a standard mini-batch training with validation evaluation
-
check_nan
(step, xp)[source]¶ Check if the result from the optimizer includes Nan values. :param step: current step of the optimizer. :type step: int :param xp: list of outputs from the optimizer :type xp: list
- Returns
True if variables were reset.
- Return type
bool
-
check_progress
(step, xp)[source]¶ Check if progress was made in the last call to the optimizer :param step: current optimizer step. :type step: int :param xp: list of outputs from the training monitors. :type xp: list
- Returns
variables were reset.
- Return type
bool
-
run
(n_train_steps, feed_train=None, n_valid_steps=1, valid_eval_freq=1, feed_valid=None, monitor_training=True)[source]¶
-
run_step
(step, ops, feed_dict)[source]¶ Run a step of the optimizer. :param step: Description of parameter step. :type step: type :param ops: Description of parameter ops. :type ops: type :param feed_dict: Description of parameter feed_dict. :type feed_dict: type
- Returns
Description of returned object.
- Return type
type
-
-
class
twodlearn.optim.
Optimizer
(loss, var_list, session=None, metrics=None, n_logging=100, log_folder=None, options=None, **kargs)[source]¶ Bases:
twodlearn.core.common.TdlModel
-
check_nan
(step, xp)[source]¶ Check if the result from the optimizer includes Nan values. :param step: current step of the optimizer. :type step: int :param xp: list of outputs from the optimizer :type xp: list
- Returns
True if variables were reset.
- Return type
bool
-
check_progress
(step, xp)[source]¶ Check if progress was made in the last call to the optimizer :param step: current optimizer step. :type step: int :param xp: list of outputs from the training monitors. :type xp: list
- Returns
variables were reset.
- Return type
bool
-
run
(n_train_steps, feed_train=None, n_valid_steps=1, valid_eval_freq=1, feed_valid=None, monitor_training=True)[source]¶
-
run_step
(step, ops, feed_dict)[source]¶ Run a step of the optimizer. :param step: Description of parameter step. :type step: type :param ops: Description of parameter ops. :type ops: type :param feed_dict: Description of parameter feed_dict. :type feed_dict: type
- Returns
Description of returned object.
- Return type
type
-