tensorflow / tensorflow/java

Keras LSTM-RNN layer

Abierto
#274 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Java
Estrellas
928
Forks
227
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information

  • TensorFlow version (you are using): 2.3.1
  • Are you willing to contribute it (Yes/No): Yes, when able and available

Describe the feature and the current behavior/state.
There is a high-level API on Keras to LSTM layers on top of RNN that allows getting LSTM output as simple as this:

lstm_module = LSTMModule(5)   
lstm_input = tf.constant([[0.1, 0.2], [0.3, 0.4]], shape=[1, 2, 2])
lstm_output = lstm_module(lstm_input)

A definition of the LSTM Layer with Model Subclassing API from Tensorflow:

class LSTMModule(tf.keras.layers.Layer):

    def __init__(self, lstm_dims):
        super().__init__()
        self.lstm_dims = lstm_dims
        self.lstm = LSTM(lstm_dims, return_sequences=True, return_state=True)

    def call(self, inputs):
        # Forward pass
        ini_hidden_state = tf.zeros(shape=[1, self.lstm_dims]), tf.zeros(shape=[1, self.lstm_dims])
        return self.get_lstm_output(self.lstm, inputs, ini_hidden_state)

    @staticmethod
    def get_lstm_output(lstm_model, input_sequence, initial_state):
        output = lstm_model(input_sequence, initial_state=initial_state)
        hidden_states, hidden_state, cell_state = output[0], output[1], output[2]
        return hidden_states, hidden_state, cell_state

Will this change the current api? How?
This will add a new feature to tensorflow-framework module.

Who will benefit with this feature?
Anyone that requires deep learning to solve sequence classification and prediction problems and everyone who is already familiar with Keras.

Any Other info.
This feature comes from #270

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

No se nombran archivos ni pruebas. Empieza revisando el issue #270 y las APIs existentes de tensorflow-framework relacionadas con la solicitud de una capa LSTM/RNN al estilo de Keras. Se considera terminado cuando se haya establecido si la API LSTM de alto nivel solicitada pertenece a este repositorio y se haya definido el alcance de su implementación.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, tensorflow
Área
machine-learning
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.