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 torch | |
| import torch.nn as nn | |
| from torch.nn import functional as F | |
| from torch.autograd import Variable | |
| from torch import optim | |
| import numpy as np | |
| import math, random | |
| # Generating a noisy multi-sin wave |
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 argparse | |
| from collections import Counter | |
| import csv | |
| import os | |
| import torch | |
| from torch.autograd import Variable | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| import torch.utils.data as data | |
| import tarfile |
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
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Cookie; | |
| use Illuminate\Support\Facades\Mail; | |
| use Illuminate\Support\Facades\Session; | |
| use Ratchet\WebSocket\Version\RFC6455\Connection; |
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 multiprocessing | |
| import pandas as pd | |
| import numpy as np | |
| def _apply_df(args): | |
| df, func, num, kwargs = args | |
| return num, df.apply(func, **kwargs) | |
| def apply_by_multiprocessing(df,func,**kwargs): | |
| workers=kwargs.pop('workers') |
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
| # Time Series Testing | |
| import keras.callbacks | |
| from keras.models import Sequential | |
| from keras.layers.core import Dense, Activation, Dense, Dropout | |
| from keras.layers.recurrent import LSTM | |
| # Call back to capture losses | |
| class LossHistory(keras.callbacks.Callback): | |
| def on_train_begin(self, logs={}): | |
| self.losses = [] |
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 __future__ import print_function | |
| import numpy as np | |
| from keras.callbacks import Callback | |
| from keras.layers import Dense | |
| from keras.layers import LSTM | |
| from keras.models import Sequential | |
| from numpy.random import choice | |
| from utils import prepare_sequences |
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 pandas as pd | |
| def compute_market_prices(prices): | |
| """Compute market prices according to the trading competition recipe. | |
| Parameters | |
| ---------- | |
| prices : DataFrame |
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 | |
| def array_for_sliding_window(x, wshape): | |
| """Build a sliding-window representation of x. | |
| The last dimension(s) of the output array contain the data of | |
| the specific window. The number of dimensions in the output is | |
| twice that of the input. | |
| Parameters |
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
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.