dicee.static_funcs
Functions
Add inverse triples into dask dataframe |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load weights and initialize pytorch module from namespace arguments |
|
Construct Ensemble Of weights and initialize pytorch module from namespace arguments |
|
|
|
Detect most efficient data type for a given triples |
|
Store Pytorch model into disk |
|
|
|
Add randomly constructed triples |
|
|
|
|
|
|
|
Save it as CSV if memory allows. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @TODO: CD: Renamed this function |
|
|
|
|
|
|
Create |
|
Module Contents
- dicee.static_funcs.create_recipriocal_triples(x)[source]
Add inverse triples into dask dataframe :param x: :return:
- dicee.static_funcs.select_model(args: dict, is_continual_training: bool = None, storage_path: str = None)[source]
- dicee.static_funcs.load_model(path_of_experiment_folder: str, model_name='model.pt', verbose=0) Tuple[object, Tuple[dict, dict]] [source]
Load weights and initialize pytorch module from namespace arguments
- dicee.static_funcs.load_model_ensemble(path_of_experiment_folder: str) Tuple[dicee.models.base_model.BaseKGE, Tuple[pandas.DataFrame, pandas.DataFrame]] [source]
Construct Ensemble Of weights and initialize pytorch module from namespace arguments
Detect models under given path
Accumulate parameters of detected models
Normalize parameters
Insert (3) into model.
- dicee.static_funcs.numpy_data_type_changer(train_set: numpy.ndarray, num: int) numpy.ndarray [source]
Detect most efficient data type for a given triples :param train_set: :param num: :return:
- dicee.static_funcs.save_checkpoint_model(model, path: str) None [source]
Store Pytorch model into disk
- dicee.static_funcs.store(trained_model, model_name: str = 'model', full_storage_path: str = None, save_embeddings_as_csv=False) None [source]
- dicee.static_funcs.add_noisy_triples(train_set: pandas.DataFrame, add_noise_rate: float) pandas.DataFrame [source]
Add randomly constructed triples :param train_set: :param add_noise_rate: :return:
- dicee.static_funcs.save_embeddings(embeddings: numpy.ndarray, indexes, path: str) None [source]
Save it as CSV if memory allows. :param embeddings: :param indexes: :param path: :return:
- dicee.static_funcs.deploy_triple_prediction(pre_trained_kge, str_subject, str_predicate, str_object)[source]
- dicee.static_funcs.deploy_tail_entity_prediction(pre_trained_kge, str_subject, str_predicate, top_k)[source]
- dicee.static_funcs.deploy_head_entity_prediction(pre_trained_kge, str_object, str_predicate, top_k)[source]
- dicee.static_funcs.deploy_relation_prediction(pre_trained_kge, str_subject, str_object, top_k)[source]
- dicee.static_funcs.vocab_to_parquet(vocab_to_idx, name, path_for_serialization, print_into)[source]
- dicee.static_funcs.exponential_function(x: numpy.ndarray, lam: float, ascending_order=True) torch.FloatTensor [source]
- dicee.static_funcs.evaluate(entity_to_idx, scores, easy_answers, hard_answers)[source]
# @TODO: CD: Renamed this function Evaluate multi hop query answering on different query types
- dicee.static_funcs.download_files_from_url(base_url: str, destination_folder='.') None [source]
- Parameters:
base_url (e.g. “https://files.dice-research.org/projects/DiceEmbeddings/KINSHIP-Keci-dim128-epoch256-KvsAll”)
destination_folder (e.g. "KINSHIP-Keci-dim128-epoch256-KvsAll")