Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denadai2
denadai2 / train_keras.py
Created June 10, 2016 09:24
Deep Learning Report Task1 - Scene recognition from images
from keras.models import Sequential
import numpy as np
import pandas as pd
from keras.utils.np_utils import to_categorical
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.optimizers import Adam, SGD
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.callbacks import ModelCheckpoint, EarlyStopping
from PIL import Image
from keras.layers.normalization import BatchNormalization
@denadai2
denadai2 / gist:badf13e5a3a10301f38a
Created December 28, 2014 13:16
Sperical (kilometers/miles/radius) distance between two points
def earth_radius_at_latitude(lat, unit='km'):
"""Calculates the earth radius at a specific latitude
(http://en.wikipedia.org/wiki/Earth_radius)
Args:
lat: float representing the latitude of a point
unit: string (km/miles) representing the measure unit
Returns:
the earth radius in the specified unit