# Path: reservoir_nn/models/nlp_rnn.py
# KERAS_RNN_LAYERS = immutabledict({
#     "LSTM": tf.keras.layers.LSTM,
#     "RNN": tf.keras.layers.SimpleRNN,
# })
# RNN_RESERVOIR_LAYER_NAMES = frozenset({"DenseReservoirRNNTemporal"})
# def recurrent_reservoir_language_model(
#     reservoir_weight: Optional[np.ndarray] = None,
#     vocab_size: int = 20000,
#     embed_dim: int = 128,
#     reservoir_params: Optional[Dict[str, Any]] = None,
#     layer_name: str = "DenseReservoirRNNTemporal",
#     units: int = 200,
#     learning_rate: float = 0.001) -> tf.keras.Sequential:
# def recurrent_reservoir_nlp_classifier(
#     reservoir_weight: Optional[np.ndarray],
#     num_classes: int = 2,
#     vocab_size: int = 20000,
#     embed_dim: int = 128,
#     reservoir_params: Optional[Dict[str, Any]] = None,
#     layer_name: str = "DenseReservoirRNNTemporal",
#     units: int = 200,
#     learning_rate: float = 0.001) -> tf.keras.Model:
# def get_rnn_layer(reservoir_weight: Optional[np.ndarray] = None,
#                   reservoir_params: Optional[Dict[str, Any]] = None,
#                   layer_name: str = "LSTM",
#                   units: int = 200,
#                   return_sequences: bool = False) -> tf.keras.layers.Layer:


from absl.testing import absltest
from absl.testing import parameterized
from reservoir_nn.models import nlp_rnn
import numpy as np
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for nlp_rnn."""



LAYER_NAMES = frozenset(["DenseReservoirRNNTemporal", "RNN", "LSTM"])


class NlpRnnTest(parameterized.TestCase):

  @parameterized.parameters(LAYER_NAMES)
  def test_lstm_language_model_outputs_correct_shape(self, model_name):
    weights = np.ones((42, 42))
    batch_size = 5
    vocab_size = 50
    maxlen = 20
    embed_dim = 10

# Path: reservoir_nn/models/nlp_rnn.py
# KERAS_RNN_LAYERS = immutabledict({
#     "LSTM": tf.keras.layers.LSTM,
#     "RNN": tf.keras.layers.SimpleRNN,
# })
# RNN_RESERVOIR_LAYER_NAMES = frozenset({"DenseReservoirRNNTemporal"})
# def recurrent_reservoir_language_model(
#     reservoir_weight: Optional[np.ndarray] = None,
#     vocab_size: int = 20000,
#     embed_dim: int = 128,
#     reservoir_params: Optional[Dict[str, Any]] = None,
#     layer_name: str = "DenseReservoirRNNTemporal",
#     units: int = 200,
#     learning_rate: float = 0.001) -> tf.keras.Sequential:
# def recurrent_reservoir_nlp_classifier(
#     reservoir_weight: Optional[np.ndarray],
#     num_classes: int = 2,
#     vocab_size: int = 20000,
#     embed_dim: int = 128,
#     reservoir_params: Optional[Dict[str, Any]] = None,
#     layer_name: str = "DenseReservoirRNNTemporal",
#     units: int = 200,
#     learning_rate: float = 0.001) -> tf.keras.Model:
# def get_rnn_layer(reservoir_weight: Optional[np.ndarray] = None,
#                   reservoir_params: Optional[Dict[str, Any]] = None,
#                   layer_name: str = "LSTM",
#                   units: int = 200,
#                   return_sequences: bool = False) -> tf.keras.layers.Layer:


# Path: reservoir_nn/models/nlp_rnn_test.py
from absl.testing import absltest
from absl.testing import parameterized
from reservoir_nn.models import nlp_rnn
import numpy as np

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for nlp_rnn."""



LAYER_NAMES = frozenset(["DenseReservoirRNNTemporal", "RNN", "LSTM"])


class NlpRnnTest(parameterized.TestCase):

  @parameterized.parameters(LAYER_NAMES)
  def test_lstm_language_model_outputs_correct_shape(self, model_name):
    weights = np.ones((42, 42))
    batch_size = 5
    vocab_size = 50
    maxlen = 20
    embed_dim = 10

    model = nlp_rnn.recurrent_reservoir_language_model(