Model Training

The model train file trains the model on the download dataset and other parameters specified in the assemblyconfig file The main function runs the training and populates the created file structure with the trained model, logs and plots

class dlmfg.core.model_train.TrainModel(batch_size, epochs, split_ratio)[source]

Train Model Class, the initialization parameters are parsed from modelconfig_train.py file

Parameters
  • batch_size (int (required)) – mini batch size while training the model

  • epochs (int (required)) – no of epochs to conduct training

  • split_ratio – train and validation split for the model

The class contains run_train_model method

run_train_model(model, X_in, Y_out, model_path, logs_path, plots_path, activate_tensorboard=0, run_id=0, tl_type='full_fine_tune')[source]

run_train_model function trains the model on the dataset and saves the trained model,logs and plots within the file structure, the function prints the training evaluation metrics

Parameters
  • model (keras.models (required)) – 3D CNN model compiled within the Deep Learning Class, refer https://keras.io/models/model/ for more information

  • X_in (numpy.array [samples*voxel_dim*voxel_dim*voxel_dim*deviation_channels] (required)) – Train dataset input (predictor variables), 3D Voxel representation of the cloud of point and node deviation data obtained from the VRM software based on the sampling input

  • Y_out (numpy.array [samples*assembly_kccs] (required)) – Train dataset output (variables to predict), Process Parameters/KCCs obtained from sampling

  • model_path (str (required)) – model path at which the trained model is saved

  • logs_path (str (required)) – logs path where the training metrics file is saved

  • plots_path (str (required)) – plots path where model training loss convergence plot is saved

  • activate_tensorboard (int) – flag to indicate if tensorboard should be added in model callbacks for better visualization, 0 by default, set to 1 to activate tensorboard

  • run_id (int) – Run id index used in data study to conduct multiple training runs with different dataset sizes, defaults to 0