a94f7b93251013d51d9918c27ab2569eb526a494,examples/convolutional_model.py,,,#,3

Before Change


image_data = list()

for image in image_array:
    image_data.append(np.array([image]).reshape((list(target_dimensions)+[channels])))
image_data = np.array(image_data)
if verbose:
    print("Processed image data shape: " + str(image_data.shape))

After Change


X_train, X_test, y_train, y_test = train_test_split(image_data, labels,
                                                    test_size=validation_split, random_state=42, stratify=labels)
train_gen = DataGenerator().fit(X_train, y_train)
test_gen = DataGenerator().fit(X_test, y_test)
print("Training net...")
model = ConvolutionalNN(target_dimensions, channels, label_count)
// model.fit(image_data, labels, validation_split)
model.fit_generator(train_gen.generate(target_dimensions, batch_size=5),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: thoughtworksarts/EmoPy
Commit Name: a94f7b93251013d51d9918c27ab2569eb526a494
Time: 2018-02-14
Author: puneethp@thoughtworks.com
File Name: examples/convolutional_model.py
Class Name:
Method Name:


Project Name: thoughtworksarts/EmoPy
Commit Name: a94f7b93251013d51d9918c27ab2569eb526a494
Time: 2018-02-14
Author: puneethp@thoughtworks.com
File Name: examples/timedelay_conv_model.py
Class Name:
Method Name:


Project Name: shibing624/pycorrector
Commit Name: ee47125e34737db84aafe4908ebf60f052e4f023
Time: 2018-04-11
Author: 507153809@qq.com
File Name: pycorrector/rnn_crf/train.py
Class Name:
Method Name: train