AIFEBaseModel {aifeducation} | R Documentation |
Base class for models using neural nets
Description
Abstract class for all models that do not rely on the python library 'transformers'.
Value
Objects of this 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.
Public fields
model
('tensorflow_model' or 'pytorch_model')
Field for storing the 'tensorflow' or 'pytorch' model after loading.model_config
('list()')
List for storing information about the configuration of the model.last_training
('list()')
List for storing the history, the configuration, and the results of the last training. This information will be overwritten if a new training is started.-
last_training$start_time
: Time point when training started. -
last_training$learning_time
: Duration of the training process. -
last_training$finish_time
: Time when the last training finished. -
last_training$history
: History of the last training. -
last_training$data
: Object of classtable
storing the initial frequencies of the passed data. -
last_training$config
: List storing the configuration used for the last training.
-
Methods
Public methods
Method get_model_info()
Method for requesting the model information.
Usage
AIFEBaseModel$get_model_info()
Returns
list
of all relevant model information.
Method get_text_embedding_model()
Method for requesting the text embedding model information.
Usage
AIFEBaseModel$get_text_embedding_model()
Returns
list
of all relevant model information on the text embedding model underlying the model.
Method set_publication_info()
Method for setting publication information of the model.
Usage
AIFEBaseModel$set_publication_info(authors, citation, url = NULL)
Arguments
authors
List of authors.
citation
Free text citation.
url
URL of a corresponding homepage.
Returns
Function does not return a value. It is used for setting the private members for publication information.
Method get_publication_info()
Method for requesting the bibliographic information of the model.
Usage
AIFEBaseModel$get_publication_info()
Returns
list
with all saved bibliographic information.
Method set_model_license()
Method for setting the license of the model.
Usage
AIFEBaseModel$set_model_license(license = "CC BY")
Arguments
license
string
containing the abbreviation of the license or the license text.
Returns
Function does not return a value. It is used for setting the private member for the software license of the model.
Method get_model_license()
Method for getting the license of the model.
Usage
AIFEBaseModel$get_model_license()
Arguments
license
string
containing the abbreviation of the license or the license text.
Returns
string
representing the license for the model.
Method set_documentation_license()
Method for setting the license of the model's documentation.
Usage
AIFEBaseModel$set_documentation_license(license = "CC BY")
Arguments
license
string
containing the abbreviation of the license or the license text.
Returns
Function does not return a value. It is used for setting the private member for the documentation license of the model.
Method get_documentation_license()
Method for getting the license of the model's documentation.
Usage
AIFEBaseModel$get_documentation_license()
Arguments
license
string
containing the abbreviation of the license or the license text.
Returns
Returns the license as a string
.
Method set_model_description()
Method for setting a description of the model.
Usage
AIFEBaseModel$set_model_description( eng = NULL, native = NULL, abstract_eng = NULL, abstract_native = NULL, keywords_eng = NULL, keywords_native = NULL )
Arguments
eng
string
A text describing the training, its theoretical and empirical background, and output in English.native
string
A text describing the training , its theoretical and empirical background, and output in the native language of the model.abstract_eng
string
A text providing a summary of the description in English.abstract_native
string
A text providing a summary of the description in the native language of the model.keywords_eng
vector
of keyword in English.keywords_native
vector
of keyword in the native language of the model.
Returns
Function does not return a value. It is used for setting the private members for the description of the model.
Method get_model_description()
Method for requesting the model description.
Usage
AIFEBaseModel$get_model_description()
Returns
list
with the description of the classifier in English and the native language.
Method save()
Method for saving a model.
Usage
AIFEBaseModel$save(dir_path, folder_name)
Arguments
dir_path
string
Path of the directory where the model should be saved.folder_name
string
Name of the folder that should be created within the directory.
Returns
Function does not return a value. It saves the model to disk.
Method load()
Method for importing a model.
Usage
AIFEBaseModel$load(dir_path)
Arguments
dir_path
string
Path of the directory where the model is saved.
Returns
Function does not return a value. It is used to load the weights of a model.
Method get_package_versions()
Method for requesting a summary of the R and python packages' versions used for creating the model.
Usage
AIFEBaseModel$get_package_versions()
Returns
Returns a list
containing the versions of the relevant R and python packages.
Method get_sustainability_data()
Method for requesting a summary of tracked energy consumption during training and an estimate of the resulting CO2 equivalents in kg.
Usage
AIFEBaseModel$get_sustainability_data()
Returns
Returns a list
containing the tracked energy consumption, CO2 equivalents in kg, information on the
tracker used, and technical information on the training infrastructure.
Method get_ml_framework()
Method for requesting the machine learning framework used for the model.
Usage
AIFEBaseModel$get_ml_framework()
Returns
Returns a string
describing the machine learning framework used for the classifier.
Method get_text_embedding_model_name()
Method for requesting the name (unique id) of the underlying text embedding model.
Usage
AIFEBaseModel$get_text_embedding_model_name()
Returns
Returns a string
describing name of the text embedding model.
Method check_embedding_model()
Method for checking if the provided text embeddings are created with the same TextEmbeddingModel as the model.
Usage
AIFEBaseModel$check_embedding_model(text_embeddings)
Arguments
text_embeddings
Object of class EmbeddedText or LargeDataSetForTextEmbeddings.
Returns
TRUE
if the underlying TextEmbeddingModel are the same. FALSE
if the models differ.
Method count_parameter()
Method for counting the trainable parameters of a model.
Usage
AIFEBaseModel$count_parameter()
Returns
Returns the number of trainable parameters of the model.
Method is_configured()
Method for checking if the model was successfully configured. An object can only be used if this
value is TRUE
.
Usage
AIFEBaseModel$is_configured()
Returns
bool
TRUE
if the model is fully configured. FALSE
if not.
Method get_private()
Method for requesting all private fields and methods. Used for loading and updating an object.
Usage
AIFEBaseModel$get_private()
Returns
Returns a list
with all private fields and methods.
Method get_all_fields()
Return all fields.
Usage
AIFEBaseModel$get_all_fields()
Returns
Method returns a list
containing all public and private fields
of the object.
Method clone()
The objects of this class are cloneable with this method.
Usage
AIFEBaseModel$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.