code: def define_model(trial):
      n_layers = trial.suggest_int("n_layers", 1, 3)
      layers = []
  
      in_features = 28 * 28
      for i in range(n_layers):
          out_features = trial.suggest_int(
              "n_units_l{}".format(i), 4, 128
          )
          layers.append(nn.Linear(in_features, out_features))
          layers.append(nn.ReLU())
          p = trial.suggest_float("dropout_{}".format(i), 0.2, 0.5)
          layers.append(nn.Dropout(p))
  
          in_features = out_features
  
      layers.append(nn.Linear(in_features, 10))
      layers.append(nn.LogSoftmax(dim=1))
  
      return nn.Sequential(*layers)
  
file_path: optuna/tutorial/20_recipes/002_multi_objective.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import torchvision
  from fvcore.nn import FlopCountAnalysis
  import optuna
label_desc: Use image node_id 1 for calling a global function with example usage: define_model(trial) and returns: nn