This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| r = np.arange(1.0, 11.0, 0.1) | |
| n = len(r)**3 | |
| pts = np.empty((n, 3)) | |
| i = 0 | |
| for x in r: | |
| for y in r: | |
| for z in r: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.layers import Input, Masking, LSTM, Dense | |
| from keras.models import Model | |
| import numpy as np | |
| # Case1: model with return_sequences=True (output_shape = (1,10,1) ) | |
| ############################################################## | |
| input1 = Input(batch_shape=(1, 10, 16)) | |
| mask1 = Masking(mask_value=2.)(input1) | |
| lstm1 = LSTM(16, return_sequences=True)(mask1) | |
| dense_layer = Dense(1, activation='sigmoid') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.layers import Masking, Dense | |
| from keras.layers.recurrent import LSTM | |
| from keras.models import Sequential | |
| import numpy as np | |
| np.set_printoptions(precision=4) | |
| np.random.seed(1) | |