tensorflow / tensorflow/java

Keras LSTM-RNN layer

Đang mở
#274 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Java
Star
928
Fork
227
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách xem xét issue #270 và các API tensorflow-framework hiện có liên quan đến yêu cầu về một layer LSTM/RNN theo kiểu Keras. Công việc được xem là hoàn tất khi xác định được API LSTM cấp cao được yêu cầu có thuộc repository này hay không và xác định được phạm vi triển khai của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, tensorflow
Lĩnh vực
machine-learning
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.