Skip to content

Instantly share code, notes, and snippets.

@Muhammad-Yunus
Last active April 15, 2020 01:57
Show Gist options
  • Save Muhammad-Yunus/3fc30895bb68ca447536f85d3bd8083e to your computer and use it in GitHub Desktop.
Save Muhammad-Yunus/3fc30895bb68ca447536f85d3bd8083e to your computer and use it in GitHub Desktop.
MLP ODE Timeseries
def split_sequence(sequence, n_steps):
_X, _y = list(), list()
for i in range(len(sequence)):
# find the end of this pattern
end_ix = i + n_steps
# check if we are beyond the sequence
if end_ix > len(sequence)-1:
break
# gather input and output parts of the pattern
seq_x, seq_y = sequence[i:end_ix], sequence[end_ix]
_X.append(seq_x)
_y.append(seq_y)
return np.array(_X), np.array(_y)
#split data ODE Critical Dumped
x, y = split_sequence(Critical_Dumped, n_sampling)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment