I'm pretty new to hydra
and I'm trying to better understand the config.yaml
file. I'm undertaking a deep learning experiment where I have two separate models, an embedding network and a simple fully connected neural network. The first one is going to create features, and the second is basically fine-tuning the results.
I would like to quickly access some parameters relative to the configuration for both models. For now I just tried to incorporate everything in the same config.yaml
file
parameters_embnet:
_target_: model.EmbNet_Lightning
model_name: 'EmbNet'
num_atom_feats: 200
dim_target: 128
loss: 'log_ratio'
lr: 1e-3
wd: 5e-6
data_embnet:
_target_: data.CompositionDataModule
dataset_name: 's'
batch_size: 64
data_path: './s.csv'
wandb_embnet:
_target_: pytorch_lightning.loggers.WandbLogger
name: embnet_logger
trainer_embnet:
max_epochs: 1000
parameters_nn:
_target_: neuralnet.SimpleNeuralNetwork_Lightning
input_size: 200
lr: 1e-3
wd: 5e-6
loss: 'log_ratio'
data_nn:
_target_: neuralnet.nn_dataset_lightning
batch_size: 128
wandb_nn:
_target_: pytorch_lightning.loggers.WandbLogger
name: neuralnet_logger
trainer_nn:
max_epochs: 150
but trying to use such configuration results in a ConstructorError
since some keys (like lr
) are duplicated across the two models. Now, I'm just wondering whether this is the correct way to proceed, or if I should set up multiple config.yaml
files and what's the most optimal way to do that.