You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i get accuracy is 10%, if i just modify the x_Train by the way:
mean = [125.307, 122.95, 113.865]
std = [62.9932, 62.0087, 66.7048]
for i in range(3):
x_train[:,:,i] = ( x_train[:,:,i] - mean[i])/std[i]
x_test[:,:,i] = (x_test[:,:, i] - mean[i])/std[i]
but i get accuracy 52%,if i modify the x_Train by the way:
x_train /= 255
x_test /= 255
i donnot know why i cannot get the same result with you?
please help.thx.
my code is :
import keras
from keras import optimizers
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Conv2D,Dense, Flatten, MaxPooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard
i get accuracy is 10%, if i just modify the x_Train by the way:
mean = [125.307, 122.95, 113.865]
std = [62.9932, 62.0087, 66.7048]
for i in range(3):
x_train[:,:,i] = ( x_train[:,:,i] - mean[i])/std[i]
x_test[:,:,i] = (x_test[:,:, i] - mean[i])/std[i]
but i get accuracy 52%,if i modify the x_Train by the way:
x_train /= 255
x_test /= 255
i donnot know why i cannot get the same result with you?
please help.thx.
my code is :
import keras
from keras import optimizers
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Conv2D,Dense, Flatten, MaxPooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard
batch_size = 128
epochs = 10
iteration = 391
num_classes = 10
log_filepath = './lenet'
##kernel_initializer:?????
def build_model():
model = Sequential()
model.add(Conv2D(6, (5,5), padding = 'valid', activation = 'relu', kernel_initializer = 'he_normal', input_shape = (32, 32, 3)))
model.add(MaxPooling2D((2,2),strides = (2,2)))
model.add(Conv2D(16, (5,5), padding = 'valid', activation = 'relu', kernel_initializer = 'he_normal'))
model.add(MaxPooling2D((2,2), strides = (2,2)))
model.add(Flatten())
model.add(Dense(120, activation = 'relu', kernel_initializer = 'he_normal'))
model.add(Dense(84, activation = 'relu', kernel_initializer = 'he_normal'))
model.add(Dense(num_classes, activation = 'softmax', kernel_initializer = 'he_normal'))
def scheduler(epoch):
learning_rate_init = 0.02
if epoch >= 80:
learning_rate_init = 0.01
if epoch >= 150:
learning_rate_init = 0.004
return learning_rate_init
if name == 'main':
(x_train, y_train), (x_test, y_test) = cifar10.load_data() ## values ???
y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
The text was updated successfully, but these errors were encountered: