code: def lstm(opytimizer):
      # Gathers parameters from Opytimizer
      # Pay extremely attention to their order when declaring due to their bounds
      learning_rate = opytimizer[0][0]
  
      # Creates the LSTM
      lstm = LSTMGenerator(
          vocab_size=corpus.vocab_size,
          embedding_size=256,
          hidden_size=512,
      )
  
      # As NALP's LSTMs are stateful, we need to build it with a fixed batch size
      lstm.build((64, None))
  
      # Compiling the LSTM
      lstm.compile(
          optimizer=tf.optimizers.Adam(learning_rate=learning_rate),
          loss=tf.losses.SparseCategoricalCrossentropy(
              from_logits=True
          ),
          metrics=[
              tf.metrics.SparseCategoricalAccuracy(name="accuracy")
          ],
      )
  
      # Fitting the LSTM
      history = lstm.fit(dataset.batches, epochs=100)
  
      # Gathers last iteration's accuracy
      acc = history.history["accuracy"][-1]
  
      return 1 - acc
  
file_path: opytimizer/examples/integrations/nalp/lstm.py
imports: import tensorflow
  from nalp.corpus import TextCorpus
  from nalp.datasets import LanguageModelingDataset
  from nalp.encoders import IntegerEncoder
  from nalp.models.generators import LSTMGenerator
  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 1 for calling a global function with example usage: lstm(opytimizer) and returns: unknown