Skip to content

Instantly share code, notes, and snippets.

@tomonari-masada
tomonari-masada / least_squares_1.py
Created May 16, 2016 11:20
The simplest least squares with TensorFlow
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 1])
y_ = tf.placeholder(tf.float32, [None, 1])
b = tf.Variable(tf.zeros([1]))
w = tf.Variable(tf.zeros([1, 1]))
y = w * x + b
@fonnesbeck
fonnesbeck / kernel_regression.py
Created April 3, 2014 11:23
Kernel regression using Theano
"""
Implementation of kernel regression:
"""
from pylearn.old_dataset.learner import OfflineLearningAlgorithm
from theano import tensor as T
from theano.tensor.nnet import prepend_1_to_each_row
from theano.scalar import as_scalar
from common.autoname import AutoName
import theano