Skip to content

Instantly share code, notes, and snippets.

View osipov's full-sized avatar

Carl Osipov osipov

View GitHub Profile
@osipov
osipov / parks.ipynb
Created April 22, 2019 21:55
parks.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Setup the model
x <- tf$placeholder(tf$float32, shape(NULL, 1024L))
W <- tf$Variable(tf$zeros(shape(1024L, 10L)))
b <- tf$Variable(tf$zeros(shape(10L)))
t <- tf$nn$softmax(tf$matmul(x, W) + b)
# Specify the loss and optimizer
t_ <- tf$placeholder(tf$float32, shape(NULL, 10L))
xent <- tf$reduce_mean(-tf$reduce_sum(t_ * log(t), reduction_indices=1L))
batch_step <- tf$train$GradientDescentOptimizer(0.5)$minimize(xent)
titanic_train_ds <- csv_record_spec("titanic.train.csv")
@osipov
osipov / tensorflow.md
Last active April 24, 2019 01:10
TensorFlow w/R

Using TensorFlow in R

Chapter 1 - Your first "Hello World" neural network with TensorFlow in R

  • Lesson 1.1 - Getting started with TensorFlow

    • A learning objective: Create tensors in R and use the building blocks of TensorFlow APIs
  • Lesson 1.2 - Implementing graphs and loops in TensorFlow

    • A learning objective: Implement a multilayer neural network and evaluate it for predictions against a sample dataset
  • Lesson 1.3 - Training a neural network with gradient descent

WITH Customers AS (
(SELECT 1 AS Customer, 1 AS Tea, 1 AS Scones) UNION ALL
(SELECT 2 AS Customer, 0 AS Tea, 1 AS Scones) UNION ALL
(SELECT 3 AS Customer, 0 AS Tea, 0 AS Scones) UNION ALL
(SELECT 4 AS Customer, 0 AS Tea, 0 AS Scones) UNION ALL
(SELECT 5 AS Customer, 1 AS Tea, 1 AS Scones) UNION ALL
(SELECT 6 AS Customer, 1 AS Tea, 0 AS Scones) UNION ALL
(SELECT 7 AS Customer, 1 AS Tea, 0 AS Scones) UNION ALL
(SELECT 8 AS Customer, 1 AS Tea, 1 AS Scones) UNION ALL
(SELECT 9 AS Customer, 1 AS Tea, 0 AS Scones) UNION ALL