-
First install Java, Scala and Spark in Ubuntu
- Install Java
sudo apt-add-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
- Install Java
This file contains hidden or 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 pandas as pd | |
| import numpy as np | |
| import seaborn as sns | |
| from keras.layers import Dense | |
| from keras.models import Model, Sequential | |
| from keras import initializers | |
| ## ---------- Create our linear dataset --------------- | |
| ## Set the mean, standard deviation, and size of the dataset, respectively |
This file contains hidden or 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
| states = ('Rainy', 'Sunny') | |
| observations = ('walk', 'shop', 'clean') | |
| start_probability = {'Rainy': 0.6, 'Sunny': 0.4} | |
| transition_probability = { | |
| 'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3}, | |
| 'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6}, | |
| } |
This file contains hidden or 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 | |
| def gradient_descent_runner(points, starting_m, starting_b, learning_rate, num_iterations): | |
| m = starting_m | |
| b = starting_b | |
| for i in range(num_iterations): | |
| m, b = step_gradient(m, b, np.array(points), learning_rate) | |
| return m, b |
This file contains hidden or 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/python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| ================================================================= | |
| Selecting dimensionality reduction with Pipeline and GridSearchCV | |
| ================================================================= | |
| This example constructs a pipeline that does dimensionality | |
| reduction followed by prediction with a support vector | |
| classifier. It demonstrates the use of GridSearchCV and |
##VGG16 model for Keras
This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
This file contains hidden or 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
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ | |
| - created cats/ and dogs/ subfolders inside train/ and validation/ | |
| - put the cat pictures index 0-999 in data/train/cats |
This file contains hidden or 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
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: jupyter | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Start jupyter | |
| # Description: This file should be used to construct scripts to be | |
| # placed in /etc/init.d. |
This file contains hidden or 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
| # Prepare Steps: | |
| # We are assuming we’re using CUDA 7.5 | |
| # Clone and Build latest Mesos with GPUs (skipping instructions here…) | |
| # CUDA prepare script for ubuntu 14.04 with AWS G2 instance. | |
| # http://tleyden.github.io/blog/2015/11/22/cuda-7-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/ | |
| # Start mesos master and slave | |
| # ./mesos-master --work_dir=/tmp/mesos | |
| # sudo GLOG_v=1 ./mesos-slave --isolation=gpu/nvidia --master=`hostname -i`:5050 --nvidia_gpu_devices=0 | |
| # Add cuda bin to PATH |