dicee.executer

Classes

Execute

A class for Training, Retraining and Evaluation a model.

ContinuousExecute

A subclass of Execute Class for retraining

Module Contents

class dicee.executer.Execute(args, continuous_training=False)[source]

A class for Training, Retraining and Evaluation a model.

  1. Loading & Preprocessing & Serializing input data.

  2. Training & Validation & Testing

  3. Storing all necessary info

args
is_continual_training
trainer = None
trained_model = None
knowledge_graph = None
report
evaluator = None
start_time = None
read_or_load_kg()[source]
read_preprocess_index_serialize_data() None[source]

Read & Preprocess & Index & Serialize Input Data

  1. Read or load the data from disk into memory.

  2. Store the statistics of the data.

Parameter

rtype:

None

load_indexed_data() None[source]

Load the indexed data from disk into memory

Parameter

rtype:

None

save_trained_model() None[source]

Save a knowledge graph embedding model

  1. Send model to eval mode and cpu.

  2. Store the memory footprint of the model.

  3. Save the model into disk.

  4. Update the stats of KG again ?

Parameter

rtype:

None

end(form_of_labelling: str) dict[source]

End training

  1. Store trained model.

  2. Report runtimes.

  3. Eval model if required.

Parameter

rtype:

A dict containing information about the training and/or evaluation

write_report() None[source]

Report training related information in a report.json file

start() dict[source]

Start training

# (1) Loading the Data # (2) Create an evaluator object. # (3) Create a trainer object. # (4) Start the training

Parameter

rtype:

A dict containing information about the training and/or evaluation

class dicee.executer.ContinuousExecute(args)[source]

Bases: Execute

A subclass of Execute Class for retraining

  1. Loading & Preprocessing & Serializing input data.

  2. Training & Validation & Testing

  3. Storing all necessary info

During the continual learning we can only modify * num_epochs * parameter. Trained model stored in the same folder as the seed model for the training. Trained model is noted with the current time.

previous_args
args
continual_start() dict[source]

Start Continual Training

  1. Initialize training.

  2. Start continual training.

  3. Save trained model.

Parameter

rtype:

A dict containing information about the training and/or evaluation