Base class for models using neural nets
Source:R/obj_ModelsBasedOnTextEmbeddings.R
ModelsBasedOnTextEmbeddings.RdAbstract class for all models that do not rely on the python library 'transformers'. All models of this class require text embeddings as input. These are provided as objects of class EmbeddedText or LargeDataSetForTextEmbeddings.
Objects of this class containing fields and methods used in several other classes in 'AI for Education'.
This class is not designed for a direct application and should only be used by developers.
See also
Other R6 Classes for Developers:
AIFEBaseModel,
AIFEMaster,
BaseModelCore,
ClassifiersBasedOnTextEmbeddings,
DataManagerClassifier,
LargeDataSetBase,
TEClassifiersBasedOnProtoNet,
TEClassifiersBasedOnRegular,
TokenizerBase
Super classes
AIFEMaster -> AIFEBaseModel -> ModelsBasedOnTextEmbeddings
Methods
Inherited methods
AIFEMaster$get_all_fields()AIFEMaster$get_documentation_license()AIFEMaster$get_ml_framework()AIFEMaster$get_model_config()AIFEMaster$get_model_description()AIFEMaster$get_model_info()AIFEMaster$get_model_license()AIFEMaster$get_package_versions()AIFEMaster$get_private()AIFEMaster$get_publication_info()AIFEMaster$get_sustainability_data()AIFEMaster$is_configured()AIFEMaster$is_trained()AIFEMaster$set_documentation_license()AIFEMaster$set_model_description()AIFEMaster$set_model_license()AIFEMaster$set_publication_info()AIFEBaseModel$count_parameter()
ModelsBasedOnTextEmbeddings$get_text_embedding_model()
Method for requesting the text embedding model information.
ModelsBasedOnTextEmbeddings$get_text_embedding_model_name()
Method for requesting the name (unique id) of the underlying text embedding model.
ModelsBasedOnTextEmbeddings$check_embedding_model()
Method for checking if the provided text embeddings are created with the same TextEmbeddingModel as the model.
Arguments
text_embeddingsObject of class EmbeddedText or LargeDataSetForTextEmbeddings.
Returns
TRUE if the underlying TextEmbeddingModel are the same. FALSE if the models differ.
ModelsBasedOnTextEmbeddings$save()
Method for saving a model.
ModelsBasedOnTextEmbeddings$load_from_disk()
loads an object from disk and updates the object to the current version of the package.
ModelsBasedOnTextEmbeddings$plot_training_history()
Method for requesting a plot of the training history. This method requires the R package 'ggplot2' to work.
Usage
ModelsBasedOnTextEmbeddings$plot_training_history(
final_training = FALSE,
pl_step = NULL,
measure = "loss",
ind_best_model = TRUE,
ind_selected_model = TRUE,
x_min = NULL,
x_max = NULL,
y_min = NULL,
y_max = NULL,
add_min_max = TRUE,
text_size = 10L
)Arguments
final_trainingboolIfFALSEthe values of the performance estimation are used. IfTRUEonly the epochs of the final training are used.pl_stepintNumber of the step during pseudo labeling to plot. Only relevant if the model was trained with active pseudo labeling.measureMeasure to plot.
ind_best_modelboolIfTRUEthe plot indicates the best states of the model according to the chosen measure.ind_selected_modelboolIfTRUEthe plot indicates the states of the model which are used after training. These are the final states of the fold or the final state of the last training loop.x_minintMinimal value for x-axis. Set toNULLfor an automatic adjustment. Allowed values:\( x \)
x_maxintMaximal value for x-axis. Set toNULLfor an automatic adjustment. Allowed values:\( x \)
y_minintMinimal value for y-axis. Set toNULLfor an automatic adjustment. Allowed values:\( x \)
y_maxintMaximal value for y-axis. Set toNULLfor an automatic adjustment. Allowed values:\( x \)
add_min_maxboolIfTRUEthe minimal and maximal values during performance estimation are port of the plot. IfFALSEonly the mean values are shown. Parameter is ignored iffinal_training=TRUE.text_sizeintSize of text elements. Allowed values:\(1 <= x \)
ModelsBasedOnTextEmbeddings$plot_learning_rate()
Method for requesting a plot that shows the analysis for selecting a good learning rate.
ModelsBasedOnTextEmbeddings$get_lr_statistics()
Method for requesting the learning rate statistics.
Returns
Returns a data.frame with the following columns
index: Index of the learning rate
lr_rate: Learning rate as
factor.start_loss: Loss before any training.
final_loss: Loss after the complete training.
delta: Normalized loss as (final_loss-start_loss)/start_loss.
smoothed_delta: Smoothed normalized loss.
best_range:
boolindicating if the learning rate is part of the best range.selected:
boolindicating if the learning rate is selected for further training.
Prepare history data of objects Function for preparing the history data of a model in order to be plotted in AI for Education - Studio.
final bool If TRUE the history data of the final training is used for the data set.
pl_step int If use_pl=TRUE select the step within pseudo labeling for which the data should be prepared.
Returns a named list with the training history data of the model. The
reported measures depend on the provided model.
Utils Studio Developers internal