Skip to content

Instantly share code, notes, and snippets.

View sandgate-dev's full-sized avatar
☀️

toolshed sandgate-dev

☀️
View GitHub Profile
model = Sequential([
Conv2D(32, (3, 3), input_shape=input_shape, activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.2),
Conv2D(32, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.2),
Conv2D(64, (3, 3), activation='relu'),
model = models.Sequential([
Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3)),
MaxPooling2D((2, 2)),
Conv2D(64, (3, 3), activation='relu'),
MaxPooling2D((2, 2)),
Flatten(),
Dense(64, activation='relu'),
Dense(128, activation='relu'),
'''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 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
@sandgate-dev
sandgate-dev / classifier_from_little_data_script_3.py
Created February 5, 2019 20:42 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''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 is a test' should equal 'ThIs Is A TeSt'
def to_weird_case_word(string):
return "".join(c.upper() if i%2 == 0 else c for i, c in enumerate(string.lower()))
def to_weird_case(string):
return " ".join(to_weird_case_word(str) for str in string.split())
# The mode is the value that shows up the most in a dataset. A dataset can have 0 or more modes.
# If no value shows up more than once, the dataset is considered to have no mode value.
# If two numbers show up the same number of times, that dataset is considered bimodal.
# Datasets where multiple values all show up the same number of times are considered multimodal.
def get_mode(data):
most = max(list(map(data.count, data)))
return list(set(filter(lambda x: data.count(x) == most, data)))
@sandgate-dev
sandgate-dev / 001_convertarraytoobject1-js.markdown
Created August 11, 2018 13:13
001_convertArrayToObject1.js
@sandgate-dev
sandgate-dev / 002_convertobjecttolist1-js.markdown
Created August 11, 2018 13:13
002_convertObjectToList1.js
@sandgate-dev
sandgate-dev / 003_convertarraytoobject2-js.markdown
Created August 11, 2018 13:13
003_convertArrayToObject2.js