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
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. |
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
#!/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 |
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 os | |
import struct | |
import numpy as np | |
""" | |
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py | |
which is GPL licensed. | |
""" | |
def read(dataset = "training", path = "."): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 enums import * | |
import random | |
import tensorflow as tf | |
import numpy as np | |
class DeepGambler: | |
def __init__(self, learning_rate=0.1, discount=0.95, exploration_rate=1.0, iterations=10000): | |
self.learning_rate = learning_rate | |
self.discount = discount # How much we appreciate future reward over current | |
self.exploration_rate = 1.0 # Initial exploration rate |
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
'''Implementation and Demostration of Dynamic Time Warping | |
Requires : python 2.7.x, Numpy 1.7.1, Matplotlib, 1.2.1''' | |
from math import * | |
import numpy as np | |
import sys | |
def DTW(A, B, window = sys.maxint, d = lambda x,y: abs(x-y)): | |
# create the cost matrix | |
A, B = np.array(A), np.array(B) |