Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AmazaspShumik/mtlearn
/ functions
Functions
71 in github.com/AmazaspShumik/mtlearn
⨍
Functions
71
◇
Types & classes
17
↓ 10 callers
Function
has_arg
Checks whether callable accepts given keyword argument Parameters ---------- function: callable Function which which arguments
mtlearn/utils/layer_utils.py:5
↓ 5 callers
Method
set_data_and_directory
Create test directory and test data
tests/base_mtl_specification.py:13
↓ 4 callers
Function
build_activation_functions
Helper method for setting activation functions
mtlearn/experiments/uci_income_census/base_hyperparam_builder.py:9
↓ 4 callers
Function
build_preprocessing_layer_uci_income
Helper method that builds preprocesing layer for UCI Census Income dataset.
mtlearn/experiments/uci_income_census/base_hyperparam_builder.py:47
↓ 3 callers
Function
get_constrained_model
Builds soft parameter sharing multi-task model n_features: int Number of features in the data l1_regularizer: float L1 pe
tests/constrained_mtl_test.py:13
↓ 3 callers
Function
get_mmoe_model
Create Multigate Mixture of Experts Model Parameters ---------- input_shape: int Number of features apply_dropout: bool
tests/mmoe_test.py:10
↓ 3 callers
Function
get_omoe_model
Create Multigate Mixture of Experts Model Parameters ---------- input_shape: int Number of features apply_dropout: bool
tests/omoe_test.py:10
↓ 2 callers
Function
build_task_towers
Helper method to build task specific networks
mtlearn/experiments/uci_income_census/base_hyperparam_builder.py:20
↓ 2 callers
Function
get_mtl_model_with_moe
Create Mixture of Linear Model Experts Parameters ---------- input_shape: int Number of features apply_dropout: bool
tests/moe_test.py:15
↓ 2 callers
Function
regularize_norm_diff
Regularize l2/l1 distance between variables Parameters ---------- variables: List of lists List of variables norm: str
mtlearn/layers/soft_contrained_mtl.py:9
↓ 1 callers
Method
__init__
(self, expert_layers: List[Layer], add_dropout: bool = False,
mtlearn/layers/moe.py:115
↓ 1 callers
Method
_build_moe_layers
Builds Mixture of Experts Layers if they are not provided by the user
mtlearn/layers/mmoe.py:72
↓ 1 callers
Method
_preprocess_cat_feature
Preprocess categorical column: use either embeddings or one-hot. Categorical feature can be represented either as an embedding or as
mtlearn/experiments/uci_income_census/uci_census_preprocessing_layer.py:55
↓ 1 callers
Method
_split_features_targets
Split feature from targets, remove education, income_50K and marital_stat from the features as described in section 6.3
mtlearn/experiments/uci_income_census/utils/data_loader_preprocessor.py:110
↓ 1 callers
Method
build
Builds main component of the layer by creating dropout layer that has the same binary mask for each element in the batch. Pa
mtlearn/layers/moe.py:36
↓ 1 callers
Function
build_experts
Helper method to build expert networks for OMOE and MMOE
mtlearn/experiments/uci_income_census/base_hyperparam_builder.py:66
↓ 1 callers
Method
get_config
Config of the MOE layer
mtlearn/layers/moe.py:180
↓ 1 callers
Function
get_cross_stitch_model
Creates model with cross-stitch units Parameters ---------- n_features: int Shape of the input
tests/cross_stitch_test.py:11
↓ 1 callers
Function
get_model
Creates Mixture of Experts Model
examples/moe_example.py:22
↓ 1 callers
Function
load_census_data_uci
Checks whether data are in path directory or in current directory if path is not specified, loads data from the uci and splits test set into
mtlearn/experiments/uci_income_census/utils/load_census_data.py:9
↓ 1 callers
Function
preprocess_features
Encode categorical features, represent them as dense set of integers and save the mapping from c. Normalize all of numeric feature using min-max
mtlearn/experiments/uci_income_census/utils/preprocess_features.py:10
↓ 1 callers
Function
run_tests
()
tests/run.py:4
↓ 1 callers
Method
test_goodness_of_fit
Checks Goodness of fit for single task problem
tests/moe_test.py:73
Method
__init__
(self, *args, **kwargs)
tests/moe_test.py:59
Method
__init__
(self, *args, **kwargs)
tests/cross_stitch_test.py:34
Method
__init__
(self, *args, **kwargs)
tests/omoe_test.py:77
Method
__init__
(self, *args, **kwargs)
tests/mmoe_test.py:78
Method
__init__
(self, *args, **kwargs)
tests/constrained_mtl_test.py:54
Method
__init__
(self, all_columns: str, cat_features_dim: Dict[str, int],
mtlearn/experiments/uci_income_census/uci_census_preprocessing_layer.py:37
Method
__init__
(self, local_path: str = None, write_data_locally: bool = True,
mtlearn/experiments/uci_income_census/utils/data_loader_preprocessor.py:75
Method
__init__
(self, expert_layers: List[Layer], task_layers: List[Layer],
mtlearn/layers/mmoe.py:53
Method
__init__
(self, dropout_rate: float = 0.1, **kwargs )
mtlearn/layers/moe.py:28
Method
__init__
(self, architecture: List[int], hidden_layer_activation: str = "elu",
mtlearn/layers/mlp.py:31
Method
__init__
(self, mtl_layers: List[Layer], l1_regularizer: float, l2_r
mtlearn/layers/soft_contrained_mtl.py:64
Method
_build_moe_layers
Builds Mixture of Experts Layers if they are not provided by the user
mtlearn/layers/omoe.py:47
Method
build
(self, batch_input_shape: List[tf.TensorShape] )
mtlearn/layers/cross_stitch_block.py:18
Function
build_hyper_cross_stitched_model
Build model for Cross Stitched networks Parameters ---------- hp: instance of HyperParameters Hyper-Parameters that define a
mtlearn/experiments/uci_income_census/hyper_models.py:145
Function
build_hyper_l2_constrained
Build model for L2 constrained multi-task learning model Parameters ---------- hp: instance of HyperParameters Hyper-Paramet
mtlearn/experiments/uci_income_census/hyper_models.py:231
Function
build_hyper_moe_model
Build hypermodel either for Multi-Gate Mixture of Experts or One-Gate Mixture of experts Parameters ---------- hp: instance of H
mtlearn/experiments/uci_income_census/hyper_models.py:17
Function
build_hyper_mtl_shared_bottom
Build model for L2 constrained multi-task learning model Parameters ---------- hp: instance of HyperParameters Hyper-Paramet
mtlearn/experiments/uci_income_census/hyper_models.py:328
Method
call
Defines forward pass of the Preprocessing Layer, Builds embeddings for sparse categorical features and one-hot encodings for
mtlearn/experiments/uci_income_census/uci_census_preprocessing_layer.py:85
Method
call
Forward pass of the Multi-Gate Mixture of Experts model. Parameters ---------- inputs: np.array or tf.Tensor
mtlearn/layers/mmoe.py:82
Method
call
Defines forward pass for the layer, by dropping experts and then renormalizing utilization probabilities for remaining experts.
mtlearn/layers/moe.py:54
Method
call
Defines set of computations performed in the MOE layer. MOE layer can accept single tensor (in this case it assumes the same
mtlearn/layers/moe.py:133
Method
call
Forward pass of the MLP Parameters ---------- inputs: np.array or tf.Tensor Input to the model Re
mtlearn/layers/mlp.py:55
Method
call
Forward pass through constraining layer. Constraining layer can accept single tensor (in this case it assumes the same input
mtlearn/layers/soft_contrained_mtl.py:75
Method
call
Forward pass through cross-stitch block Parameters ---------- inputs: np.array or tf.Tensor List of task
mtlearn/layers/cross_stitch_block.py:36
Method
call
Forward pass of the One-Gate Mixture of Experts Model Parameters ---------- inputs: np.array or tf.Tensor
mtlearn/layers/omoe.py:51
Method
get_config
Get configuration for Preprocessing Layer
mtlearn/experiments/uci_income_census/uci_census_preprocessing_layer.py:126
Method
get_config
Get configuration of the Multi-Gate Mixture of Experts
mtlearn/layers/mmoe.py:114
Method
get_config
Config of the ExpertUtilizationDropout layer
mtlearn/layers/moe.py:82
Method
get_config
Get MLP configuration
mtlearn/layers/mlp.py:74
Method
get_config
(self)
mtlearn/layers/soft_contrained_mtl.py:115
Method
get_education_marital_stat_tasks
Get group two data as described in section 6.3 of the paper. Second group of data contains two binary target variables: 1] Ma
mtlearn/experiments/uci_income_census/utils/data_loader_preprocessor.py:127
Method
get_income_marital_stat_tasks
Get group one data as described in section 6.3 of the paper. First group of data contains two binary target variables: 1] Mar
mtlearn/experiments/uci_income_census/utils/data_loader_preprocessor.py:148
Method
get_raw_train_val_test
Get raw data
mtlearn/experiments/uci_income_census/utils/data_loader_preprocessor.py:164
Method
models
Create models with Mixture of Experts Layer, one model with dropout and another one without dropout.
tests/moe_test.py:64
Method
models
(self)
tests/cross_stitch_test.py:39
Method
models
(self)
tests/base_mtl_specification.py:26
Method
models
Create intances of One-Gate Mixture of Experts Model with / without expert dropout and with / without base layer
tests/omoe_test.py:82
Method
models
Create MMOEs models for testing
tests/mmoe_test.py:83
Method
models
(self)
tests/constrained_mtl_test.py:77
Method
run_trial
Evaluates set of hyperparameters Parameters ---------- trial: kerastuner.Trial Object that holds informa
mtlearn/experiments/uci_income_census/tuner.py:14
Method
test_cross_stitch_normalization_and_shape
Test that elements of each column are convex combinations, and that output is a list of tensors with the same dimensionality
tests/cross_stitch_test.py:42
Method
test_func_diff
(a, b)
tests/utils_test.py:11
Method
test_func_sum
(a=2, b=3)
tests/utils_test.py:14
Method
test_goodness_of_fit
Checks how well model fitted training data, we want to check that model can perfectly fit data (i.e. overfit)
tests/base_mtl_specification.py:52
Method
test_has_arg
(self)
tests/utils_test.py:9
Method
test_input_types_output_shapes
Checks whether layer can properly handle two types of input: 1) list of tensors 2) tensors And whether output shape
tests/constrained_mtl_test.py:58
Method
test_save_load_mtl
Tests saving and loading
tests/moe_test.py:83
Method
test_save_load_mtl
Checks saving and loading functionality of multitask model
tests/base_mtl_specification.py:29