Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| #!/bin/sh | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| require(quantmod) | |
| require(SIT) | |
| dvi.indicator = function(prices) { | |
| dvi = TTR:::DVI(prices)[,3] | |
| indicator.long = ifelse(dvi <= 0.5, 1, 0) | |
| indicator.short = ifelse(dvi > 0.5, -1, 0) | |
| indicator = reclass(cbind(indicator.short + indicator.long), prices) |
| """ | |
| A deep neural network with or w/o dropout in one file. | |
| """ | |
| import numpy, theano, sys, math | |
| from theano import tensor as T | |
| from theano import shared | |
| from theano.tensor.shared_randomstreams import RandomStreams | |
| from collections import OrderedDict |
| import random, time, operator, math | |
| from deap import base | |
| from deap import creator | |
| from deap import tools | |
| from deap import gp | |
| import cloud | |
| import jsonrpclib |
| import operator | |
| import numpy | |
| from math import sqrt | |
| from deap import gp | |
| # Our dataset is 100 random arrays of 0s and 1s | |
| # and the function we are trying to find is simply |
| # Mostly stolen from deap's symbreg GP example | |
| import operator | |
| import math | |
| import random | |
| import string | |
| import inspect | |
| import ctypes | |
| import numpy | |
| from scipy import optimize |
| import operator | |
| import math | |
| import random | |
| import struct | |
| import numpy | |
| from deap import algorithms | |
| from deap import base | |
| from deap import creator |
| #' Saves symbols (from an environment) to a specified directory | |
| #' | |
| #' The files (one per symbol) are saved in \code{dir}. The file name | |
| #' is the symbol itself, and the file extension is RData. | |
| #' | |
| #' @param symbols The symbols | |
| #' @param dir The destination folder (file system directory). It must exist. | |
| #' @param env The environment containing the symbols | |
| #' | |
| #' @examples |
| function gnn (cases, wide, tall, population, iterations, error_fn, error_thresh) { | |
| var inputs = cases[0][0].length; | |
| var outputs = cases[0][1].length; | |
| // declare net, provide input layer | |
| var net = [new Array(inputs)]; | |
| // create input neurons in input layer | |
| for (var i = 0; i < inputs; i++) | |
| net[0][i] = {output: 0} | |
| // create hidden layers | |
| for (var x = 0; x < wide; x++) { |