我创建了一个简单的视图,但在创建视图时忘记添加 WITH READ ONLY。现在我想改变视图并添加 WITH READ ONLY 选项。对它的查询是什么?
我创建了一个简单的猫狗图像分类(卷积神经网络).拥有每班7,000人的培训数据和每班5,500人的验证数据.
我的问题是我的系统没有完成所有时代.如果有人能够解释选择nb_epoch,samples_per_epoch和nb_val_samples值的比例或标准,以获得最大限度的训练和验证数据,我将非常感激.
以下是我的代码:
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras.callbacks import EarlyStopping
import numpy as np
from keras.preprocessing import image
from keras.utils.np_utils import probas_to_classes
model=Sequential()
model.add(Convolution2D(32, 5,5, input_shape=(28,28,3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Convolution2D(32,3,3))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Flatten())
model.add(Dense(128))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(2))
model.add(Activation('softmax'))
train_datagen=ImageDataGenerator(rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
test_datagen=ImageDataGenerator(rescale=1./255)
train_generator=train_datagen.flow_from_directory(
r'F:\data\train',
target_size=(28,28),
classes=['dog','cat'],
batch_size=10,
class_mode='categorical',
shuffle=True)
validation_generator=test_datagen.flow_from_directory(
r'F:\data\validation',
target_size=(28, 28),
classes=['dog','cat'],
batch_size=10,
class_mode='categorical',
shuffle=True)
model.compile(loss='categorical_crossentropy', optimizer='rmsprop', …Run Code Online (Sandbox Code Playgroud)