Created
October 10, 2018 11:33
-
-
Save flowpoint/ae2d665b0606694dcb635b5074d078ed to your computer and use it in GitHub Desktop.
causal conv eager issue keras tensorflow
This file contains 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 tensorflow as tf | |
#import keras # works, but wants tf.contrib.eager.Variable for eager execution somewhere | |
from tensorflow import keras # <- errors on padding='causal' | |
import numpy as np | |
#tf.enable_eager_execution() # | |
data = np.random.random([1,1,256]) | |
leaky_relu = tf.nn.leaky_relu | |
model = keras.Sequential([ | |
keras.layers.Conv1D(16, 2, padding='causal', dilation_rate=2, activation=leaky_relu) ]) | |
opt = tf.train.AdamOptimizer() | |
model.compile(opt, loss = 'mean_squared_error', metrics=['accuracy']) | |
model.fit(data, y=np.random.random([1,1,16]), batch_size=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment