Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Sequence Models/Week 1/Jazz improvisation with LSTM/__pycache__/lstm.cpython-36.pyc
Views: 13381
3 �RZ � @ sR d Z ddlmZ ddlmZ ddlmZmZmZ ddl m Z ddlZd dd �Z dS )a, Author: Ji-Sung Kim Project: deepjazz Purpose: Builds an LSTM, a type of recurrent neural network (RNN). Code was built while significantly referencing public examples from the Keras documentation on GitHub: https://github.com/fchollet/keras/blob/master/examples/lstm_text_generation.py � )�print_function)� Sequential)�Dense� Activation�Dropout)�LSTMN� c C s| t t| ��}d}g }g }xDtdt | �| |�D ],}|j| ||| � � |j| || � q.W tdt |�� tjt |�||ftjd�} tjt |�|ftjd�} xPt|�D ]D\}}x&t|�D ]\}} d| |||| f<