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 pickle | |
| import random | |
| import numpy as np | |
| import tensorflow as tf | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| def unpickle(file): | |
| fo = open(file, 'rb') | |
| dict = pickle.load(fo) |
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 pickle | |
| import random | |
| import numpy as np | |
| import tensorflow as tf | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| def unpickle(file): | |
| fo = open(file, 'rb') | |
| dict = pickle.load(fo) |
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 yahoo_finance import Share | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import tensorflow as tf | |
| import random | |
| %matplotlib inline | |
| class DecisionPolicy: | |
| def select_action(self, current_state, step): | |
| pass |
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 pickle | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| def unpickle(file): | |
| fo = open(file, 'rb') | |
| dict = pickle.load(fo) | |
| fo.close() | |
| return dict |
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 numpy as np | |
| import tensorflow as tf | |
| from sklearn import datasets | |
| class Autoencoder: | |
| def __init__(self, input_dim, hidden_dim, epoch=250, batch_size=10, learning_rate=0.001): | |
| self.epoch = epoch | |
| self.learning_rate = learning_rate | |
| self.batch_size = batch_size | |
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 numpy as np | |
| import tensorflow as tf | |
| class HMM(object): | |
| def __init__(self, initial_prob, trans_prob, obs_prob): | |
| self.N = np.size(initial_prob) | |
| self.initial_prob = initial_prob | |
| self.trans_prob = trans_prob | |
| self.emission = tf.constant(obs_prob) | |
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 numpy as np | |
| import tensorflow as tf | |
| class HMM(object): | |
| def __init__(self, initial_prob, trans_prob, obs_prob): | |
| self.N = np.size(initial_prob) | |
| self.initial_prob = initial_prob | |
| self.trans_prob = trans_prob | |
| self.emission = tf.constant(obs_prob) | |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| def traindata(): | |
| x1_label0 = np.random.normal(1, 1, (100, 1)) | |
| x2_label0 = np.random.normal(1, 1, (100, 1)) | |
| x1_label1 = np.random.normal(5, 1, (100, 1)) | |
| x2_label1 = np.random.normal(4, 1, (100, 1)) | |
| x1_label2 = np.random.normal(8, 1, (100, 1)) |
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 numpy as np | |
| import tensorflow as tf | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| learning_rate = 0.1 | |
| training_epochs = 2000 | |
| def sigmoid(x): | |
| return 1. / (1. + np.exp(-x)) |
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 numpy as np | |
| import tensorflow as tf | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| learning_rate = 0.01 | |
| training_epochs = 1000 | |
| def sigmoid(x): | |
| return 1. / (1. + np.exp(-x)) |