mechanoChemML.workflows.mr_learning.mrnn_models

Module Contents

Classes

callback_PrintDot Display training progress by printing a single dot for each completed epoch
user_DNN_kregl1l2_gauss_grad DNN with regularization layers and Gaussian noise layers.
CNN_user_supervise similar as CNN supervise, but with the check_layer() function

Functions

build_learningrate(config) Build different learning rates based on the input
build_optimizer(config) Build different optimizers based on the input
check_point_callback(config) Return the check point call back function
tensor_board_callback(config) Return the tensor board call back function
build_callbacks(config) Build different call back functions based on the input
my_mse_loss() Use defined mse loss function
my_mse_loss_with_grad(BetaP=1000.0) Use defined mse loss function with penalty term for physics-based constraint
build_loss(config, loss_model=None) Build loss function based on the input
shift_labels(config, dataset, dataset_index, dataset_frame, data_file) Shift label based on the trained-NN predictions
load_one_model(old_config_file) Based on the config file name to load pre-saved model info
load_trained_model(trained_model_lists) Load trained models
user_DNN_kregl1l2_gauss_grad_setup(config, train_dataset, train_labels, NodesList, Activation, train_stats)
DNN_kregl1l2_gauss(config, train_dataset, train_labels, NodesList, Activation) Customized DNN with different regularizations
add_input_layer(config, model, train_dataset, Name, Node, Act, padding=’valid’) Add different layers to the model
add_one_layer(config, model, Name, Node, Act, padding=’valid’, tf_name=’’) Add different layers to the model
add_output_layer(config, model, train_labels) Add an output layer to the model
CNN_supervise(config, train_dataset, train_labels, NodesList, Activation, LayerName, Padding) Generate a supervised CNN model based on the inputs
CNN_user_supervise_setup(config, train_dataset, train_labels, NodesList, Activation, LayerName, Padding) Generate a supervised CNN model based on the inputs
build_model(config, train_dataset, train_labels, set_non_trainable=False, train_stats=None) Build the NN model based on the input
mechanoChemML.workflows.mr_learning.mrnn_models.build_learningrate(config)[source]

Build different learning rates based on the input

mechanoChemML.workflows.mr_learning.mrnn_models.build_optimizer(config)[source]

Build different optimizers based on the input

class mechanoChemML.workflows.mr_learning.mrnn_models.callback_PrintDot[source]

Bases: tensorflow.keras.callbacks.Callback

Display training progress by printing a single dot for each completed epoch

on_epoch_end(self, epoch, logs)[source]
mechanoChemML.workflows.mr_learning.mrnn_models.check_point_callback(config)[source]

Return the check point call back function

mechanoChemML.workflows.mr_learning.mrnn_models.tensor_board_callback(config)[source]

Return the tensor board call back function

mechanoChemML.workflows.mr_learning.mrnn_models.build_callbacks(config)[source]

Build different call back functions based on the input

mechanoChemML.workflows.mr_learning.mrnn_models.my_mse_loss()[source]

Use defined mse loss function

mechanoChemML.workflows.mr_learning.mrnn_models.my_mse_loss_with_grad(BetaP=1000.0)[source]

Use defined mse loss function with penalty term for physics-based constraint

mechanoChemML.workflows.mr_learning.mrnn_models.build_loss(config, loss_model=None)[source]

Build loss function based on the input

mechanoChemML.workflows.mr_learning.mrnn_models.shift_labels(config, dataset, dataset_index, dataset_frame, data_file)[source]

Shift label based on the trained-NN predictions

mechanoChemML.workflows.mr_learning.mrnn_models.load_one_model(old_config_file)[source]

Based on the config file name to load pre-saved model info

mechanoChemML.workflows.mr_learning.mrnn_models.load_trained_model(trained_model_lists)[source]

Load trained models

class mechanoChemML.workflows.mr_learning.mrnn_models.user_DNN_kregl1l2_gauss_grad(config, NodesList, Activation, train_dataset, train_labels, label_scale, train_stats)[source]

Bases: tensorflow.keras.Model

DNN with regularization layers and Gaussian noise layers.

call(self, inputs)[source]
class mechanoChemML.workflows.mr_learning.mrnn_models.CNN_user_supervise(input_shape, num_output, LayerName, NodesList, Activation, Padding, OutAct)[source]

Bases: tensorflow.keras.Model

similar as CNN supervise, but with the check_layer() function

call(self, inputs, training=False)[source]
check_layer(self, inputs, layer_number=100)[source]
mechanoChemML.workflows.mr_learning.mrnn_models.user_DNN_kregl1l2_gauss_grad_setup(config, train_dataset, train_labels, NodesList, Activation, train_stats)[source]
mechanoChemML.workflows.mr_learning.mrnn_models.DNN_kregl1l2_gauss(config, train_dataset, train_labels, NodesList, Activation)[source]

Customized DNN with different regularizations

mechanoChemML.workflows.mr_learning.mrnn_models.add_input_layer(config, model, train_dataset, Name, Node, Act, padding='valid')[source]

Add different layers to the model

mechanoChemML.workflows.mr_learning.mrnn_models.add_one_layer(config, model, Name, Node, Act, padding='valid', tf_name='')[source]

Add different layers to the model

mechanoChemML.workflows.mr_learning.mrnn_models.add_output_layer(config, model, train_labels)[source]

Add an output layer to the model

mechanoChemML.workflows.mr_learning.mrnn_models.CNN_supervise(config, train_dataset, train_labels, NodesList, Activation, LayerName, Padding)[source]

Generate a supervised CNN model based on the inputs

mechanoChemML.workflows.mr_learning.mrnn_models.CNN_user_supervise_setup(config, train_dataset, train_labels, NodesList, Activation, LayerName, Padding)[source]

Generate a supervised CNN model based on the inputs

mechanoChemML.workflows.mr_learning.mrnn_models.build_model(config, train_dataset, train_labels, set_non_trainable=False, train_stats=None)[source]

Build the NN model based on the input