Created
April 16, 2019 09:04
-
-
Save yerkbn/a07ab9fa57bb1a4979f7ee2afb9671a9 to your computer and use it in GitHub Desktop.
This file contains 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 tflearn | |
from tflearn.layers.conv import conv_2d, max_pool_2d | |
from tflearn.layers.core import input_data, dropout, fully_connected | |
from tflearn.layers.estimator import regression | |
convnet = input_data(shape=[None, IMG_SIZE, IMG_SIZE, 1], name='input') | |
#layer | |
convnet = conv_2d(convnet, 32, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 64, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 32, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 64, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 32, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 64, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 32, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
#layer | |
convnet = conv_2d(convnet, 64, 2, activation='relu') | |
convnet = max_pool_2d(convnet, 2) | |
convnet = fully_connected(convnet, 1024, activation='relu') | |
convnet = dropout(convnet, 0.8) | |
convnet = fully_connected(convnet, 2, activation='softmax') | |
convnet = regression(convnet, optimizer='adam', learning_rate=LR, loss='categorical_crossentropy', name='targets') | |
model = tflearn.DNN(convnet, tensorboard_dir='log') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment