Beispiel #1
0
    def get_cnn():
        c_nn = ClusterNNTry00_V51(dp,
                                  20,
                                  en,
                                  lstm_layers=7,
                                  internal_embedding_size=96,
                                  cluster_count_dense_layers=1,
                                  cluster_count_dense_units=256,
                                  output_dense_layers=1,
                                  output_dense_units=256,
                                  cluster_count_lstm_layers=1,
                                  cluster_count_lstm_units=128,
                                  kl_embedding_size=128,
                                  kl_divergence_factor=0.1)
        c_nn.include_self_comparison = False
        c_nn.weighted_classes = True
        c_nn.class_weights_approximation = 'stochastic'
        c_nn.minibatch_size = 15
        c_nn.class_weights_post_processing_f = lambda x: np.sqrt(x)
        c_nn.set_loss_weight('similarities_output', 5.0)
        c_nn.optimizer = Adadelta(lr=5.0)

        validation_factor = 10
        c_nn.early_stopping_iterations = 15001
        c_nn.validate_every_nth_epoch = 10 * validation_factor
        c_nn.validation_data_count = c_nn.minibatch_size * validation_factor
        # c_nn.prepend_base_name_to_layer_name = False
        return c_nn
Beispiel #2
0
                      cnn_layers_per_block=1,
                      block_feature_counts=[32, 64, 128],
                      fc_layer_feature_counts=[256],
                      hidden_activation=LeakyReLU(),
                      final_activation=LeakyReLU(),
                      batch_norm_for_init_layer=False,
                      batch_norm_after_activation=True,
                      batch_norm_for_final_layer=True)

    c_nn = ClusterNNTry00_V51(dp,
                              40,
                              en,
                              lstm_layers=21,
                              internal_embedding_size=384,
                              cluster_count_dense_layers=1,
                              cluster_count_dense_units=256,
                              output_dense_layers=1,
                              output_dense_units=256,
                              cluster_count_lstm_layers=1,
                              cluster_count_lstm_units=512,
                              kl_embedding_size=128,
                              kl_divergence_factor=0.1)
    c_nn.include_self_comparison = False
    c_nn.weighted_classes = True
    c_nn.class_weights_approximation = 'stochastic'
    c_nn.minibatch_size = 15
    c_nn.class_weights_post_processing_f = lambda x: np.sqrt(x)
    c_nn.set_loss_weight('similarities_output', 5.0)
    c_nn.optimizer = Adadelta(lr=5.0)

    validation_factor = 10
Beispiel #3
0
            minimum_snippets_per_cluster=2,

            # Use this mode for the real avaluation
            snippet_merge_mode=[8, 2] if used_input_count == required_input_count else None

            # minimum_snippets_per_cluster=[(200, 200), (100, 100)],
            # window_width=[(100, 200)]
        )
        en = CnnEmbedding(
            output_size=256, cnn_layers_per_block=1, block_feature_counts=[32, 64, 128],
            fc_layer_feature_counts=[256], hidden_activation=LeakyReLU(), final_activation=LeakyReLU(),
            batch_norm_for_init_layer=False, batch_norm_after_activation=True, batch_norm_for_final_layer=True
        )

        c_nn = ClusterNNTry00_V51(dp, used_input_count, en, lstm_layers=7, internal_embedding_size=96, cluster_count_dense_layers=1, cluster_count_dense_units=256,
                                  output_dense_layers=1, output_dense_units=256, cluster_count_lstm_layers=1, cluster_count_lstm_units=128,
                                  kl_embedding_size=128, kl_divergence_factor=0.1)
        c_nn.include_self_comparison = False
        c_nn.weighted_classes = True
        c_nn.class_weights_approximation = 'stochastic'
        c_nn.minibatch_size = 35
        c_nn.class_weights_post_processing_f = lambda x: np.sqrt(x)
        c_nn.set_loss_weight('similarities_output', 5.0)
        c_nn.optimizer = Adadelta(lr=5.0)

        validation_factor = 10
        c_nn.early_stopping_iterations = 10001
        c_nn.validate_every_nth_epoch = 10 * validation_factor
        c_nn.validation_data_count = c_nn.minibatch_size * validation_factor
        # c_nn.prepend_base_name_to_layer_name = False
        print_loss_plot_every_nth_itr = 100