Skip to content

Instantly share code, notes, and snippets.

View osipov's full-sized avatar

Carl Osipov osipov

View GitHub Profile
@osipov
osipov / gist:c2a34884a647c29765ed
Created July 21, 2014 19:12
Install Scala and SBT using apt-get on Ubuntu 14.04 or any Debian derivative using apt-get
sudo apt-get remove scala-library scala
sudo wget www.scala-lang.org/files/archive/scala-2.10.4.deb
sudo dpkg -i scala-2.10.4.deb
sudo apt-get update
sudo apt-get install scala
wget http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.4/sbt.deb
sudo dpkg -i sbt.deb
sudo apt-get update
sudo apt-get install sbt
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
@osipov
osipov / main.js
Last active October 29, 2019 18:57
// Licensed under the Apache License. See footer for details.
var express = require('express');
var passport = require('passport');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser());
var cookieParser = require('cookie-parser');
app.use(cookieParser());
# 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

@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.
package org.deeplearning4j.examples.feedforward.xor;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.Updater;
import org.deeplearning4j.nn.conf.layers.DenseLayer;
import org.deeplearning4j.nn.conf.layers.OutputLayer;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
package org.deeplearning4j.examples.feedforward.xor;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.api.Model;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.Updater;
import org.deeplearning4j.nn.conf.distribution.NormalDistribution;
import org.deeplearning4j.nn.conf.distribution.UniformDistribution;
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.deeplearning4j</groupId>
<artifactId>dl4j-spark-cdh5-examples</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dl4j-spark-cdh5-examples</name>
@osipov
osipov / SQL
Created June 3, 2016 16:18
create sample address table
CREATE TABLE "address" ("address" "text", "city" "text", "state" "text", "postalCode" "text", "country" "text", "lat" "float", "lon" "float");