Closed lzw950905 closed 3 years ago
This cannot be done in parameter grid, since this is dataset related. You can only do hyperparameter selection of model related params in the grid. In order to do what you mentioned, you can run 2 different experiments by loading the datasets in the required way:
dataset = load_fb15k_237(add_reciprocal_rels=True)
In the hyperparam grid, you can set the label_smoothing
key of the loss_parameters dict to the values that you require. Here is a dummy grid. Please note that this parameter is only used with BCE loss and ConvE model.
param_grid = {
"batches_count": [10],
"seed": 0,
"epochs": [4000],
"k": [100, 50],
"eta": [5,10],
"loss": ["bce"],
# We take care of mapping the params to corresponding classes
"loss_params": {
"label_smoothing": [True, False]
},
"embedding_model_params": {
},
"regularizer": [None, "LP"],
"regularizer_params": {
"p": [2],
"lambda": [1e-4, 1e-5]
},
"optimizer": ["adam"],
"optimizer_params":{
"lr": [0.01, 0.0001]
},
"verbose": True
}
If you specify the learning rate or other parameters as a list of values, then only the values specified in the list are used. If you want random sampling then you need to pass a callable instead.
For example, see how lr is specified using a callable see the example shown in this page
Problems: