print(mconf_shemo_m.step)
print(mconf_shemo_m.classes)
print(mconf_shemo_m.features_save_name)
print(mconf_shemo_m.model_config_save_name)
print(mconf_shemo_m.training_log_name)
print(mconf_shemo_m.model_save_name)
print(mconf_shemo_m.model_h5_save_name)
print(mconf_shemo_m.model_tflite_save_name)
print(mconf_shemo_m.feature_path)
print(mconf_shemo_m.model_config_path)
print(mconf_shemo_m.training_log_path)
print(mconf_shemo_m.model_path)
print(mconf_shemo_m.model_h5_path)
print(mconf_shemo_m.model_tflite_path)
rfpconf_shemo_m = confc.RandFeatParams(df=data_info_shemo_df_m, database=confv.database_shemo, gender=confv.gender_male)
X, y = bf.build_random_features(modelconfig=mconf_shemo_m, randfeatparams=rfpconf_shemo_m)
print("--------------------Finished building features for adjusted and {gender} isolated dataset: {name}--------------------".format(gender=confv.gender_male, name=confv.dataset_shemo_male))


# MODEL & TRAINING
print("\n\n--------------------Started model training for adjusted and {gender} isolated dataset: {name}--------------------".format(gender=confv.gender_male, name=confv.dataset_shemo_male))
input_shape = (X.shape[1], X.shape[2], 1)
model = mdl.get_shemo_male_model(input_shape)

y_flat = np.argmax(y, axis=1)
class_weight = compute_class_weight('balanced', np.unique(y_flat), y_flat)
class_weight = {i : class_weight[i] for i in range(2)}

NAME = "{database}-{gender}-{modeltype}-{spec}-{time}".format(database=confv.database_shemo, gender=confv.gender_male, modeltype=confv.ml_mode_convolutional, spec="1st", time=int(time.time()))
mdl_logs_pth = os.path.join(confv.base_store, confv.log_dir)
tensorboard = TensorBoard(log_dir=mdl_logs_pth + '\\{}'.format(NAME))
Пример #2
0
print(mconf_cremad_f.features_save_name)
print(mconf_cremad_f.model_config_save_name)
print(mconf_cremad_f.training_log_name)
print(mconf_cremad_f.model_save_name)
print(mconf_cremad_f.model_h5_save_name)
print(mconf_cremad_f.model_tflite_save_name)
print(mconf_cremad_f.feature_path)
print(mconf_cremad_f.model_config_path)
print(mconf_cremad_f.training_log_path)
print(mconf_cremad_f.model_path)
print(mconf_cremad_f.model_h5_path)
print(mconf_cremad_f.model_tflite_path)
rfpconf_cremad_f = confc.RandFeatParams(df=data_info_cremad_df_f,
                                        database=confv.database_cremad,
                                        gender=confv.gender_female)
X, y = bf.build_random_features(modelconfig=mconf_cremad_f,
                                randfeatparams=rfpconf_cremad_f)
print(
    "--------------------Finished building features for adjusted and {gender} isolated dataset: {name}--------------------"
    .format(gender=confv.gender_female, name=confv.dataset_cremad_female))

# MODEL & TRAINING
print(
    "\n\n--------------------Started model training for adjusted and {gender} isolated dataset: {name}--------------------"
    .format(gender=confv.gender_female, name=confv.dataset_cremad_female))
input_shape = (X.shape[1], X.shape[2], 1)
model = mdl.get_cremad_female_model(input_shape)

y_flat = np.argmax(y, axis=1)
class_weight = compute_class_weight('balanced', np.unique(y_flat), y_flat)
class_weight = {i: class_weight[i] for i in range(2)}
print(mconf_ravdess_f.features_save_name)
print(mconf_ravdess_f.model_config_save_name)
print(mconf_ravdess_f.training_log_name)
print(mconf_ravdess_f.model_save_name)
print(mconf_ravdess_f.model_h5_save_name)
print(mconf_ravdess_f.model_tflite_save_name)
print(mconf_ravdess_f.feature_path)
print(mconf_ravdess_f.model_config_path)
print(mconf_ravdess_f.training_log_path)
print(mconf_ravdess_f.model_path)
print(mconf_ravdess_f.model_h5_path)
print(mconf_ravdess_f.model_tflite_path)
rfpconf_ravdess_f = confc.RandFeatParams(df=data_info_ravdess_df_f,
                                         database=confv.database_ravdess,
                                         gender=confv.gender_female)
X, y = bf.build_random_features(modelconfig=mconf_ravdess_f,
                                randfeatparams=rfpconf_ravdess_f)
print(
    "--------------------Finished building features for adjusted and {gender} isolated dataset: {name}--------------------"
    .format(gender=confv.gender_female, name=confv.dataset_ravdess_female))

# MODEL & TRAINING
print(
    "\n\n--------------------Started model training for adjusted and {gender} isolated dataset: {name}--------------------"
    .format(gender=confv.gender_female, name=confv.dataset_ravdess_female))
input_shape = (X.shape[1], X.shape[2], 1)
model = mdl.get_ravdess_female_model(input_shape)

y_flat = np.argmax(y, axis=1)
class_weight = compute_class_weight('balanced', np.unique(y_flat), y_flat)
class_weight = {i: class_weight[i] for i in range(2)}