Skip to content

Instantly share code, notes, and snippets.

@jkleint
jkleint / timeseries_cnn.py
Created Jul 29, 2016
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
View timeseries_cnn.py
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@jkleint
jkleint / shuffle_weights.py
Created Jul 10, 2016
Quickly re-initialize weights of a Keras model
View shuffle_weights.py
#!/usr/bin/env python
"""Demonstrate Keras model weight shuffling as fast alternative to re-creating a model."""
from __future__ import print_function
import numpy as np
from keras.layers import Dense
from keras.models import Sequential