This file contains 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 python3 | |
import re | |
from collections import defaultdict | |
def sort_word(word): | |
letters = "".join(sorted([w for w in word])) | |
return letters | |
def read_dictionary(): |
This file contains 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 Rscript | |
library(R6) | |
Cloaked <- R6::R6Class("Cloaked", | |
public = list( | |
msg = function() { | |
return(paste( | |
"this code _works_, but lintr (https://github.com/jimhester/lintr)", | |
"complains that cloak_class.R:19:8: warning: no visible binding for", |
This file contains 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/python | |
"""Why is len(grad_input) == 3 if I use Identity, but | |
len(grad_input) == 1 if I use ReLU? | |
I don't know if this is the source of all my woes in my real network. | |
Run this like so: | |
python demo.py identity | |
module=Identity() len(grad_input)=3 len(grad_output)=1 |
This file contains 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/python | |
"""BinaryStochastic interprets it's input as a probability | |
between [0,1] and | |
* with probability p, outputs a 1, and | |
* with probability (1-p) it outputs a 0. | |
Practically, this is accomplished simply by taking a random uniform | |
the size of the input and seeing if the random uniform is less than | |
the input. If true, we output a 1, if false we output a 0. |
This file contains 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/python | |
from timer_util import Timer | |
def fibonacci(n): | |
if n == 0: | |
return 0 | |
elif n == 1: | |
return 1 | |
else: |
This file contains 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/python | |
"""This will preprocess the cats data. | |
First, it splits the train data into training and validation. | |
validation is left unmolested. (Other than scaling and cropping.) | |
train tho, is further cropped and rotated randomly.""" | |
import os | |
import re | |
import math |
This file contains 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
{ | |
"client_key":"knunopkiantijnaGlok1", | |
"client_secret": "iddyadvufDijSeujowfEbphihythelkekiakphyeg", | |
"access_token": "yufBeokbytdiVoggUrlEk8", | |
"access_token_secret": "UtgazatsectyamHadNumpashawsOltirejcickmins" | |
} |
This file contains 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
require 'nn' | |
require 'optim' | |
netG = nn.Sequential() | |
ngf = 32 | |
netG:add(nn.SpatialConvolution(1, ngf, 4,4, 2,2, 1,1)) | |
netG:add(nn.ReLU(true)) | |
netG:add(nn.SpatialConvolution(ngf, ngf * 2, 4,4, 2,2, 1,1)) | |
netG:add(nn.SpatialBatchNormalization(ngf * 2)) |
This file contains 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/local/torch/install/bin/th | |
local TempDelhiCriterion, parent = torch.class('nn.TempDelhiCriterion', 'nn.MSECriterion') | |
function TempDelhiCriterion:__init() | |
parent.__init(self) | |
self.inputcpy = torch.Tensor() | |
end | |
function TempDelhiCriterion:forward(input, target) |
This file contains 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/local/torch/install/bin/th | |
require "nn" | |
require "cutorch" | |
require "cunn" | |
require "cudnn" | |
function main() | |
torch.manualSeed(12345) |