Skip to content

Commit

Permalink
use of period fixed, default period set to 1000 (keras-team#3312)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeghmir authored and fchollet committed Jul 26, 2016
1 parent f6bcaff commit 3726aba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/stateful_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
lahead = 1


def gen_cosine_amp(amp=100, period=25, x0=0, xn=50000, step=1, k=0.0001):
def gen_cosine_amp(amp=100, period=1000, x0=0, xn=50000, step=1, k=0.0001):
"""Generates an absolute cosine time series with the amplitude
exponentially decreasing
Expand All @@ -31,7 +31,7 @@ def gen_cosine_amp(amp=100, period=25, x0=0, xn=50000, step=1, k=0.0001):
cos = np.zeros(((xn - x0) * step, 1, 1))
for i in range(len(cos)):
idx = x0 + i * step
cos[i, 0, 0] = amp * np.cos(idx / (2 * np.pi * period))
cos[i, 0, 0] = amp * np.cos(2 * np.pi * idx / period)
cos[i, 0, 0] = cos[i, 0, 0] * np.exp(-k * idx)
return cos

Expand Down

0 comments on commit 3726aba

Please sign in to comment.