src.utils package
Submodules
src.utils.AE_architecture module
Created on Sun Nov 29 16:52:27 2020
@author: trduong
- class src.utils.AE_architecture.autoencoder(index_age, index_hours, index_workclass, index_education, index_marital_status, index_occupation, index_race, index_gender)[source]
Bases:
torch.nn.modules.module.Module- forward(x)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
src.utils.AE_train module
src.utils.auto-encoder-train module
src.utils.blackbox-model-train module
src.utils.blackboxmodel module
- class src.utils.blackboxmodel.BlackBox(inp_shape)[source]
Bases:
torch.nn.modules.module.Module- forward(x)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
src.utils.calculate_loss module
src.utils.datagen module
src.utils.dataloader module
- class src.utils.dataloader.DataLoader(params)[source]
Bases:
objectA data interface for public data.
- de_normalize_data(df)[source]
De-normalizes continuous features from [0,1] range to original range.
- get_minx_maxx(normalized=True)[source]
Gets the min/max value of features in normalized or de-normalized form.
- get_mads_from_training_data(normalized=False)[source]
Computes Median Absolute Deviation of features.
- get_encoded_categorical_feature_indexes()[source]
Gets the column indexes categorical features after one-hot-encoding.
- get_indexes_of_features_to_vary(features_to_vary='all')[source]
Gets indexes from feature names of one-hot-encoded data.
src.utils.helpers module
This module containts helper functions to load data and get meta deta.
- src.utils.helpers.load_adult_income_dataset(save_intermediate=False)[source]
Loads adult income dataset from https://archive.ics.uci.edu/ml/datasets/Adult and prepares the data for data analysis based on https://rpubs.com/H_Zhu/235617
- Param
save_intermediate: save the transformed dataset. Do not save by default.
src.utils.vae_model module
- class src.utils.vae_model.CF_VAE(data_size, encoded_size, d)[source]
Bases:
torch.nn.modules.module.Module- forward(x, c)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class src.utils.vae_model.AutoEncoder(data_size, encoded_size, d)[source]
Bases:
torch.nn.modules.module.Module- forward(x)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool