code: def neural_network(opytimizer):
      # Instanciating the model
      model = torch.nn.Sequential()
  
      # Some model parameters
      n_features = 64
      n_hidden = 128
      n_classes = 10
  
      # Adding first linear layer
      model.add_module(
          "linear_1", torch.nn.Linear(n_features, n_hidden, bias=False)
      )
  
      # Followed by a sigmoid activation
      model.add_module("sigmoid_1", torch.nn.Sigmoid())
  
      # And finally a secondary linear layer
      model.add_module(
          "linear_2", torch.nn.Linear(n_hidden, n_classes, bias=False)
      )
  
      # Input variables
      batch_size = 100
      epochs = 100
  
      # Gathers parameters from Opytimizer
      # Pay extremely attention to their order when declaring due to their bounds
      learning_rate = opytimizer[0][0]
      momentum = opytimizer[1][0]
  
      # Declares the loss function
      loss = torch.nn.CrossEntropyLoss(reduction="mean")
  
      # Declares the optimization algorithm
      opt = optim.SGD(
          model.parameters(), lr=learning_rate, momentum=momentum
      )
  
      # Performs training loop
      for _ in range(epochs):
          # Initial cost as 0.0
          cost = 0.0
  
          # Calculates the number of batches
          num_batches = len(X_train) // batch_size
  
          # For every batch
          for k in range(num_batches):
              # Declares initial and ending for each batch
              start, end = k * batch_size, (k + 1) * batch_size
  
              # Cost will be the loss accumulated from model's fitting
              cost += fit(
                  model,
                  loss,
                  opt,
                  X_train[start:end],
                  Y_train[start:end],
              )
  
      # Predicting samples from evaluating set
      preds = predict(model, X_val)
  
      # Calculates accuracy
      acc = np.mean(preds == Y_val)
  
      return 1 - acc
  
file_path: opytimizer/examples/integrations/pytorch/neural_network.py
imports: import numpy
  import torch
  from sklearn.datasets import load_digits
  from sklearn.model_selection import train_test_split
  from torch import optim
  from torch.autograd import Variable
  from opytimizer import Opytimizer
  from opytimizer.core import Function
  from opytimizer.optimizers.swarm import PSO
  from opytimizer.spaces import SearchSpace
label_desc: Use image node_id 3 for calling a global function with example usage: neural_network(opytimizer) and returns: unknown