Ejemplo n.º 1
0
image_fullpath_to_predict = args["image_fullpath"]
image_label_real = args["image_label_real"]
input_data = []
input_labels = []
predict_flag = False
if image_fullpath_to_predict:
    input_data = [image_fullpath_to_predict]
    predict_flag = True
if image_label_real:
    input_labels = [image_label_real]
train_set = [image_fullpath_to_predict]
setting_object = SettingsObject.Settings(
    Dictionary.string_settings_german_signal_path)
option_problem = Dictionary.string_option_signals_images_problem
options = [option_problem, cv2.IMREAD_GRAYSCALE, 60, 60]
number_of_classes = 59  # Start in 0

models = models.TFModels(setting_object=setting_object,
                         option_problem=options,
                         input_data=input_data,
                         test=None,
                         input_labels=input_labels,
                         test_labels=None,
                         number_of_classes=number_of_classes,
                         type=None,
                         validation=None,
                         validation_labels=None,
                         load_model_configuration=False,
                         predict_flag=predict_flag)
models.convolution_model_image()
Ejemplo n.º 2
0
validation_set_web_traffic = tf_reader_web_traffic.validation_set  # Test Set
train_set_web_traffic = tf_reader_web_traffic.train_set  # Train Set

del tf_reader_web_traffic

names_of_data = [
    "input_data", "validation_data", "inputs_labels", "validation_labels"
]
names_of_data_updated = [
    "input_data_updated", "validation_data_updated", "inputs_labels",
    "validation_labels"
]
names_dictionaries = ["input_validation_dictionary"]
# Load input, validation and labels from updated arrays where inputs are [number, float] where number is
# the page id and float is the visits' number

input_data, validation, input_labels, validation_labels = \
    load_numpy_arrays_generic(path_to_load=setting_object_web_traffic.accuracies_losses_path,
                              names=names_of_data_updated)
models_zillow_price = models.TFModels(
    input_data=input_data,
    input_labels=input_labels,
    validation=validation,
    validation_labels=validation_labels,
    number_of_classes=number_of_classes_web_traffic,
    setting_object=setting_object_web_traffic,
    option_problem=option_problem_web_traffic,
    load_model_configuration=False)
#with tf.device('/gpu:0'):
models_zillow_price.rnn_lstm_web_traffic_time()
Ejemplo n.º 3
0
    reader_features=reader_features)  # Reader Object with all information
"""
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# ---- DATA MINING ----
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
"""
"""
Manipulate Reader with DataMining and update it.
"""
"""
Getting train, validation (if necessary) and test set.
"""
test_set = tf_reader.test_set  # Test Set
train_set = tf_reader.train_set  # Train Set
del reader_features
del tf_reader

option_problem = Dictionary.string_option_signals_images_problem

models = models.TFModels(input=train_set[0],
                         test=test_set[0],
                         input_labels=train_set[1],
                         test_labels=test_set[1],
                         number_of_classes=number_of_classes,
                         setting_object=setting_object,
                         option_problem=option_problem,
                         load_model_configuration=True)
models.convolution_model_image()
Ejemplo n.º 4
0
# --------------------------------------------------------------------------
# ---- DATA MINING ----
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
"""
"""
Manipulate Reader with DataMining and update it.
"""
"""
Getting train, validation (if necessary) and test set.
"""
train_set = tf_reader.train_set  # Train Set
test_set = tf_reader.test_set  # Test Set

del reader_features
del tf_reader

models = models.TFModels(setting_object=setting_object,
                         option_problem=options,
                         input_data=train_set[0],
                         test=test_set[0],
                         input_labels=train_set[1],
                         test_labels=test_set[1],
                         number_of_classes=number_of_classes,
                         type=None,
                         validation=None,
                         validation_labels=None,
                         load_model_configuration=False)
#with tf.device('/cpu:0'):  # CPU
with tf.device('/gpu:0'):  # GPU
    models.convolution_model_image()
Ejemplo n.º 5
0
        reader_features=reader_features,
        settings=setting_object)  # Reader Object with all information

    x_train = tf_reader.x_train
    y_train = tf_reader.y_train
    x_test = tf_reader.x_test
    y_test = tf_reader.y_test

pt("x_train", x_train.shape)
pt("y_train", y_train.shape)
pt("x_test", x_test.shape)
pt("y_test", y_test.shape)
with tf.device('/gpu:0'):  # GPU
    models = models.TFModels(setting_object=setting_object,
                             option_problem=options,
                             input_data=x_train,
                             test=x_test,
                             input_labels=y_train,
                             test_labels=y_test,
                             number_of_classes=number_of_classes,
                             type=None,
                             validation=None,
                             validation_labels=None)
    #with tf.device('/cpu:0'):  # CPU

    models.convolution_model_image()
"""
if __name__ == '__main__':
    import multiprocessing
    multiprocessing.freeze_support()
"""