Skip to content

Instantly share code, notes, and snippets.

View osipov's full-sized avatar

Carl Osipov osipov

View GitHub Profile
@osipov
osipov / gender_equality.r
Created August 28, 2015 13:26
Gender Equality
If you select people totally at random (no discrimination!) from the population of people with >130 IQ to work at Facebook and the sd for men in the general population is 11 IQ points instead of 10 for women, you'll wind up with a 70% male workforce at Facebook.
Similarly if men had a mean IQ of 101 instead of 99 for women, Facebook would have a 66% male workforce.
From R:
women <- pnorm(130, mean = 100, sd = 10, lower.tail = FALSE)
men <- pnorm(130, mean = 100, sd = 11, lower.tail = FALSE)
scaling <- 100/(women+men)
men * scaling
[1] 70.28561
women * scaling
[1] 29.71439
{
"dependencies": {
"express": "4.x",
"express-session": "1.0.2",
"body-parser": "1.0.1",
"cookie-parser": "1.0.1",
"passport": "0.2.0",
"passport-oauth": "1.0.0",
$ cf push ibm-sso-nodejs-sample -n ibm-sso-nodejs-$RANDOM -c 'node main.js'
Updating app ibm-sso-nodejs-sample in org <your org> / space dev as <your userid>...
OK
Creating route ibm-sso-nodejs-16133.ng.bluemix.net...
OK
Binding ibm-sso-nodejs-16133.ng.bluemix.net to ibm-sso-nodejs-sample...
OK
@osipov
osipov / Makefile
Last active August 29, 2015 14:04
Makefile to download and build Spark 1.0.1 against Hadoop 2.4.0 on Ubuntu 14.04
all: prereq build
prereq:
apt-get -y install git
apt-get -y install curl
apt-get -y install openjdk-7-jdk
apt-get -y install maven
git clone https://github.com/apache/spark.git
cd spark; git checkout tags/v1.0.1
build:
export SPARK_HADOOP_VERSION=2.4.0
@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");
<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>
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;
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;
@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.
@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