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