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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 sys | |
import h5py | |
import numpy as np | |
def pygame(h5, name, board, moves): | |
for idx in range(board.shape[0]): | |
for plane in range(board.shape[1]): | |
if plane < 44: | |
# different board orderings | |
f = board[idx, plane, ...].T[:, ::-1] |
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
local grad = require 'autograd' | |
local nn = require 'nn' | |
local W1 = torch.FloatTensor(1, 1, 10, 10):normal() | |
local pooler = nn.SpatialMaxPooling(2, 2, 2, 2) | |
local unpooler = nn.SpatialMaxUnpooling(pooler) | |
-- not sure why these lines are necessary. | |
pooler.indices = torch.FloatTensor() | |
pooler.output = torch.FloatTensor() |
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 math import tan, floor | |
def f5(element): | |
assert len(element) % 2 == 0 | |
for idx in range(0 ,len(element), 2): | |
sub = element[idx:idx+2].lower() | |
v1 = ord(sub[0]) - ord('a') + 1 | |
v2 = ord(sub[1]) - ord('a') + 1 | |
if 8 - floor(tan(v1 * v2)) < 0: | |
print v1 * v2, "bad" |
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
import plyfile | |
import pylab | |
import sys | |
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import numpy as np | |
scale = 150 | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="generator" content="lshw-B.02.16" /> | |
<style type="text/css"> | |
.first {font-weight: bold; margin-left: none; padding-right: 1em;vertical-align: top; } | |
.second {padding-left: 1em; width: 100%; vertical-align: center; } | |
.id {font-family: monospace;} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.