gist install test.
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 numpy as np | |
import matplotlib.pyplot as plt | |
class NeuralNetwork: | |
def __init__(self): | |
self.hw = 0.01 * np.random.randn(50, 4) | |
self.hb = np.zeros(50) | |
self.ow = 0.01 * np.random.randn(3, 50) | |
self.ob = np.zeros(3) |
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 tensorflow as tf | |
import numpy as np | |
features = [tf.contrib.layers.real_valued_column("x", dimension=1)] | |
estimator = tf.contrib.learn.LinearRegressor(feature_columns=features) | |
x = np.array([1., 2., 3., 4.]) | |
y = np.array([0., -1., -2., -3.]) |
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 tensorflow as tf | |
W = tf.Variable([.3], tf.float32) | |
b = tf.Variable([-.3], tf.float32) | |
x = tf.placeholder(tf.float32) | |
model = W * x + b | |
y = tf.placeholder(tf.float32) | |
loss = tf.reduce_sum(tf.square(model - y)) |
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
class User < ActiveRecord::Base | |
attr_accessible :name, :password, :status | |
end |
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 python | |
import sys | |
import re | |
import os | |
dir = os.environ["TM_DIRECTORY"] | |
if dir.find("controllers") != -1: | |
#controllers | |
re_symbol = re.compile(r"^(\s*)(?:class|def)\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*[\:\(]") |
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
# -*- coding: undecided -*- | |
require "http_util" | |
#なんちゃってDSL | |
browse http.twitter.com | |
browse http.yahoo.co.jp |
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 "open-uri" | |
class HttpUtil | |
def self.method_missing(method_name, *args) | |
HttpUtil.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self |
NewerOlder