a94f7b93251013d51d9918c27ab2569eb526a494,examples/convolutional_model.py,,,#,3
Before Change
label_count = len(labels[0])
print("Processing data...")
imageProcessor = ImageProcessor(image_data, target_dimensions=target_dimensions)
image_array = imageProcessor.process_training_data()
image_data = list()
for image in image_array:
image_data.append(np.array([image]).reshape((list(target_dimensions)+[channels])))
After Change
from neuralnets import ConvolutionalNN
from sklearn.model_selection import train_test_split
target_dimensions = (64, 64)
channels = 1
verbose = True
print("--------------- Convolutional Model -------------------")
print("Loading data...")
directory_path = "image_data/sample_image_directory"
dataLoader = DataLoader(from_csv=False, datapath=directory_path)
image_data, labels, label_map = dataLoader.get_data()
if verbose:
print("raw image data shape: " + str(image_data.shape))
label_count = labels.shape[1]
print("Creating training/testing data...")
validation_split = 0.15
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),
test_gen.generate(target_dimensions, batch_size=5),
epochs=10)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 18
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: 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: 0dec477ddd9d7151035315d2280b8e2fa0a391f9
Time: 2018-02-27
Author: puneethp@thoughtworks.com
File Name: examples/transferlearning_model.py
Class Name:
Method Name: