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
| opt = optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) | |
| model.compile(optimizer= opt, | |
| loss='binary_crossentropy', | |
| metrics=['accuracy']) | |
| Callbacks=[EarlyStopping(patience=3, restore_best_weights=True), | |
| ReduceLROnPlateau(patience=2), | |
| ModelCheckpoint(filepath='ImageDataGen_Size256_oneHOT_ClassWeights_Callbacks_SGD_L2.h5', save_best_only=True)] |
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
| visible = Input(shape=(256,256,3)) | |
| conv1 = Conv2D(16, kernel_size=(3,3), activation='relu', strides=(1, 1))(visible) | |
| conv2 = Conv2D(16, kernel_size=(3,3), activation='relu', strides=(1, 1))(conv1) | |
| bat1 = BatchNormalization()(conv2) | |
| zero1 = ZeroPadding2D(padding=(1, 1))(bat1) | |
| conv3 = Conv2D(32, kernel_size=(3,3), activation='relu', padding='valid', kernel_regularizer=regularizers.l2(0.05))(zero1) | |
| conv4 = Conv2D(32, kernel_size=(3,3), activation='relu', padding='valid', kernel_regularizer=regularizers.l2(0.05))(conv3) | |
| bat2 = BatchNormalization()(conv4) |
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
| TrainData = ImageDataGenerator( | |
| width_shift_range= 0.2, height_shift_range= 0.2, | |
| rotation_range= 90, rescale = 1/255, | |
| horizontal_flip= True, vertical_flip=True) | |
| ValidData = ImageDataGenerator( | |
| horizontal_flip=True) | |
| columns = ['Normal', 'Mild NPDR', 'Moderate NPDR', 'Severe NPDR', 'PDR'] |
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 # linear algebra | |
| import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | |
| import keras | |
| from tqdm import tqdm | |
| import os | |
| from sklearn.model_selection import train_test_split | |
| from cv2 import cv2 | |
| from PIL import Image | |
| import tensorflow as tf |
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
| 25 instructions to Install Hadoop 2.6 on Ubuntu Server 14.04- LTS. | |
| 1) (Execute all the commands as root user) #apt-get update | |
| 2) # apt-get install default-jdk | |
| 3) # java –version (Type this command) | |
| 4) # ssh-keygen -t rsa -P '' | |
| (Press enter after this don’t put the file name) | |
| 5) # cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
| 6) # wget http://mirrors.sonic.net/apache/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz |
NewerOlder