rztdl.flows package

Submodules

rztdl.flows.abstract_train_flow module

@created on: 1/10/20, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.abstract_train_flow.AbstractTrainFlow(name: str, rzt_model: rztdl.dl.model.RZTModel, optimizers: typing.Union[typing.List[str], typing.Dict[str, float]], dataset_handler: rztdl.dl.dataset.dataset_handler.DatasetHandler, split_handler: rztdl.dl.dataset.splits.TrainSplitHandler, model_save_path: str = None, callbacks: typing.List[rztdl.dl.callbacks.callback.Callback] = None, run_callbacks=True, tensorboard_summaries=True)[source]

Bases: rztdl.flows.flow.Flow

Parameters:
  • name (str) – Name for flow
  • rzt_model (RZTModel) –
  • optimizers (Union[List[str], Dict[str, float]]) – List of optimizer to train on
  • dataset_handler (DatasetHandler) –
  • split_handler (TrainSplitHandler) – split handler
  • model_save_path (Optional[str]) – Optional : Writes checkpoint after every epoch to this path, use callbacks for finer control.
  • callbacks (Optional[List[Callback]]) – List of callbacks
  • run_callbacks – Boolean If false doesn’t run any callbacks

:param tensorboard_summaries : Boolean

initialize(run_callbacks, callbacks)[source]
run_epoch()[source]

Runs a single epoch :return:

run_single_split(split, counter, freq)[source]

Runs a single split :type split: DataSplit :param split: :param counter: :param freq: :return:

run_splits(freq_splits_dict, counter)[source]

Runs all the valid splits :param freq_splits_dict: :param counter: :return:

run_tf_function[source]
run_train(epochs, batch_size)[source]

Run Train split :param epochs: No of epochs :param batch_size: No of records to be run in a single batch :return:

set_valid_test_split_handler()[source]

Sets and initializes splits, also configure log callback handler for splits :return:

rztdl.flows.distributed_persist_train_flow module

@created on: 1/13/20, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.distributed_persist_train_flow.DistributedPersistTrainFlow(name: str, rzt_model: rztdl.dl.model.RZTModel, optimizers: typing.Union[typing.List[str], typing.Dict[str, float]], dataset_handler: rztdl.dl.dataset.dataset_handler.DatasetHandler, split_handler: rztdl.dl.dataset.splits.TrainSplitHandler, model_load_path: str, model_save_path: str = None, callbacks: typing.List[rztdl.dl.callbacks.callback.Callback] = None, run_callbacks=True, tensorboard_summaries=True)[source]

Bases: rztdl.flows.distributed_train.DistributedTrainFlow

Parameters:
  • name (str) – Name for flow
  • rzt_model (RZTModel) –
  • optimizers (Union[List[str], Dict[str, float]]) – List of optimizer to train on
  • dataset_handler (DatasetHandler) –
  • split_handler (TrainSplitHandler) – split handler

:param model_load_path : Path from where model has to be loaded :type model_save_path: Optional[str] :param model_save_path: Optional : Writes checkpoint after every epoch to this path,

use callbacks for finer control.
Parameters:
  • callbacks (Optional[List[Callback]]) – List of callbacks
  • run_callbacks – Boolean If false doesn’t run any callbacks

:param tensorboard_summaries : Boolean Indicates if summaries has to be written to tensorboard

rztdl.flows.distributed_train module

@created on: 12/23/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.distributed_train.DistributedTrainFlow(name: str, rzt_model: rztdl.dl.model.RZTModel, optimizers: typing.Union[typing.List[str], typing.Dict[str, float]], dataset_handler: rztdl.dl.dataset.dataset_handler.DatasetHandler, split_handler: rztdl.dl.dataset.splits.TrainSplitHandler, model_save_path: str = None, callbacks: typing.List[rztdl.dl.callbacks.callback.Callback] = None, run_callbacks=True, tensorboard_summaries=True)[source]

Bases: rztdl.flows.abstract_train_flow.AbstractTrainFlow

Parameters:
  • name (str) – Name for flow
  • rzt_model (RZTModel) –
  • optimizers (Union[List[str], Dict[str, float]]) – List of optimizer to train on
  • dataset_handler (DatasetHandler) –
  • split_handler (TrainSplitHandler) – split handler
  • model_save_path (Optional[str]) – Optional : Writes checkpoint after every epoch to this path, use callbacks for finer control.
  • callbacks (Optional[List[Callback]]) – List of callbacks
  • run_callbacks – Boolean If false doesn’t run any callbacks

:param tensorboard_summaries : Boolean Indicates if summaries has to be written to tensorboard

train_step[source]

Runs a single batch of train => calculates costs and applies gradients :param batch: :param first_batch: Indicates if its first batch :return: list of losses

rztdl.flows.flow module

@created on: 1/10/20, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.flow.Flow(name, rzt_model)[source]

Bases: object

restore(model_load_path, keras_model, optimizers)[source]
run_tf_function[source]

rztdl.flows.inference_flow module

@created on: 02/01/20,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.flows.inference_flow.Inference(rzt_model: rztdl.dl.model.RZTModel, out_dataset_handler: rztdl.dl.dataset.out_dataset.out_dataset_handler.OutDatasetHandler, model_load_path: str, name='infer')[source]

Bases: rztdl.flows.flow.Flow

Parameters:
  • rzt_model (RZTModel) –
  • model_load_path (str) –
predict(dataset_handler, batch_size)[source]
Parameters:
Returns:

run_tf_function[source]

rztdl.flows.persist_train_flow module

@created on: 1/13/20, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.persist_train_flow.PersistTrainFlow(name: str, rzt_model: rztdl.dl.model.RZTModel, optimizers: typing.Union[typing.List[str], typing.Dict[str, float]], dataset_handler: rztdl.dl.dataset.dataset_handler.DatasetHandler, split_handler: rztdl.dl.dataset.splits.TrainSplitHandler, model_load_path: str, model_save_path: str = None, callbacks: typing.List[rztdl.dl.callbacks.callback.Callback] = None, run_callbacks=True, tensorboard_summaries=True)[source]

Bases: rztdl.flows.train_flow.TrainFlow

Parameters:
  • name (str) – Name for flow
  • rzt_model (RZTModel) –
  • optimizers (Union[List[str], Dict[str, float]]) – List of optimizer to train on
  • dataset_handler (DatasetHandler) –
  • split_handler (TrainSplitHandler) – split handler

:param model_load_path : Path from where model has to be loaded :type model_save_path: Optional[str] :param model_save_path: Optional : Writes checkpoint after every epoch to this path,

use callbacks for finer control.
Parameters:
  • callbacks (Optional[List[Callback]]) – List of callbacks
  • run_callbacks – Boolean If false doesn’t run any callbacks

:param tensorboard_summaries : Boolean Indicates if summaries has to be written to tensorboard

rztdl.flows.train_flow module

@created on: 12/23/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.flows.train_flow.TrainFlow(name: str, rzt_model: rztdl.dl.model.RZTModel, optimizers: typing.Union[typing.List[str], typing.Dict[str, float]], dataset_handler: rztdl.dl.dataset.dataset_handler.DatasetHandler, split_handler: rztdl.dl.dataset.splits.TrainSplitHandler, model_save_path: str = None, callbacks: typing.List[rztdl.dl.callbacks.callback.Callback] = (), run_callbacks=True, tensorboard_summaries=True)[source]

Bases: rztdl.flows.abstract_train_flow.AbstractTrainFlow

Parameters:
  • name (str) – Name for flow
  • rzt_model (RZTModel) –
  • optimizers (Union[List[str], Dict[str, float]]) – List of optimizer to train on
  • dataset_handler (DatasetHandler) –
  • split_handler (TrainSplitHandler) – split handler
  • model_save_path (Optional[str]) – Optional : Writes checkpoint after every epoch to this path, use callbacks for finer control.
  • callbacks (List[Callback]) – List of callbacks
  • run_callbacks – Boolean If false doesn’t run any callbacks

:param tensorboard_summaries : Boolean Indicates if summaries has to be written to tensorboard

train_step[source]

Runs a single batch of train => calculates costs and applies gradients :param batch: :return: list of losses

Module contents

@created on: 12/23/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status: