Skip to content

Instantly share code, notes, and snippets.

View stanlee321's full-sized avatar

Stanley Salvatierra stanlee321

View GitHub Profile
@stanlee321
stanlee321 / zeppelin_ubuntu.md
Created September 3, 2018 04:16 — forked from pratos/zeppelin_ubuntu.md
To Install Zeppelin [Scala and Spark] in Ubuntu 16.04LTS

Install Zeppelin in Ubuntu systems

  • 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
      
@stanlee321
stanlee321 / sgdr.py
Created October 5, 2018 04:02 — forked from jeremyjordan/sgdr.py
Keras Callback for implementing Stochastic Gradient Descent with Restarts
from keras.callbacks import Callback
import keras.backend as K
import numpy as np
class SGDRScheduler(Callback):
'''Cosine annealing learning rate scheduler with periodic restarts.
# Usage
```python
schedule = SGDRScheduler(min_lr=1e-5,
@stanlee321
stanlee321 / README.md
Created October 12, 2018 00:19 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@stanlee321
stanlee321 / docker-compose-node-mongo.yml
Created January 21, 2019 05:05 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@stanlee321
stanlee321 / import-plt.py
Created March 8, 2019 19:04 — forked from mstankie/import-plt.py
Two images side-by-side using matplotlib (pylab)
import matplotlib.pyplot as plt
@stanlee321
stanlee321 / aws_jupyter_tunnel.md
Created March 22, 2019 18:04 — forked from jakechen/aws_jupyter_tunnel.md
Creating and connecting to Jupyter Notebooks in AWS EC2

Introduction

This quick guide describes how to create a Jupyter Notebook in AWS EC2 then how to access it remotely using SSH tunneling. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.

Pre-requisites

This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.

Steps

Spin-up EC2 instance with "Deep Learning" AMI

  1. Log into EC2 console and click "Launch Instance" button.
  2. Inside "AWS Marketplace", select the "Deep Learning AMI" from AWS. I use this AMI because most of the stuff you'll need is installed already.
@stanlee321
stanlee321 / client.py
Created April 22, 2019 01:23 — forked from kylehounslow/client.py
Send and receive images using Flask, Numpy and OpenCV
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
headers = {'content-type': content_type}
@stanlee321
stanlee321 / stock_price_autoencoding.ipynb
Created April 24, 2019 03:54 — forked from GerardBCN/stock_price_autoencoding.ipynb
Stock market Bitcoin data compression with autoencoders
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from keras import backend as K
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.preprocessing.image import ImageDataGenerator
from sklearn.metrics import classification_report, confusion_matrix
#Start
train_data_path = 'F://data//Train'