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 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 | |
import numpy as np | |
import torch.optim as optim | |
from torch.autograd import Variable | |
# (1, 0) => target labels 0+2 | |
# (0, 1) => target labels 1 | |
# (1, 1) => target labels 3 | |
train = [] |
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 argparse | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
plt.style.use('bmh') | |
import numpy as np | |
import pandas as pd |
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
import numpy as np | |
import gym | |
from gym.spaces import Discrete,Box | |
# ------------------------------------------- | |
# Policies | |
# ------------------------------------------- | |
class DeterministicDiscreteActionLinearPolicy(object): |
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 'pp' | |
require 'socket' | |
module BluetoothPolarHrm | |
AF_BLUETOOTH=31 # these are correct for the Linux Bluez stack | |
BTPROTO_RFCOMM=3 | |
class << self | |
def connect_bt address_str,channel=1 | |
bytes=address_str.split(/:/).map {|x| x.to_i(16) } | |
s=Socket.new(AF_BLUETOOTH, :STREAM, BTPROTO_RFCOMM) |
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
--[[ | |
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php. | |
Example: | |
ProFi = require 'ProFi' | |
ProFi:start() | |
some_function() | |
another_function() | |
coroutine.resume( some_coroutine ) | |
ProFi:stop() |
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
---------------------------------------------------------------------- | |
-- CIFAR 8x8 | |
opt.scale = 8 | |
opt.geometry = {3, opt.scale, opt.scale} | |
local input_sz = opt.geometry[1] * opt.geometry[2] * opt.geometry[3] | |
local numhid = 600 | |
model_D = nn.Sequential() | |
model_D:add(nn.Reshape(input_sz)) | |
model_D:add(nn.Linear(input_sz, numhid)) | |
model_D:add(nn.ReLU()) |
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
import bpy | |
# get the material | |
mat = bpy.data.materials['Material'] | |
# get the nodes | |
nodes = mat.node_tree.nodes | |
# clear all nodes to start clean | |
for node in nodes: |
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
import re | |
bvh_file = "Example1.bvh" | |
def identifier(scanner, token): return "IDENT", token | |
def operator(scanner, token): return "OPERATOR", token | |
def digit(scanner, token): return "DIGIT", token | |
def open_brace(scanner, token): return "OPEN_BRACE", token | |
def close_brace(scanner, token): return "CLOSE_BRACE", token |
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
# Alec Radford, Indico, Kyle Kastner | |
# License: MIT | |
""" | |
Convolutional VAE in a single file. | |
Bringing in code from IndicoDataSolutions and Alec Radford (NewMu) | |
Additionally converted to use default conv2d interface instead of explicit cuDNN | |
""" | |
import theano | |
import theano.tensor as T | |
from theano.compat.python2x import OrderedDict |
NewerOlder