Beispiel #1
0
def init_plot_and_save_gates(data_input, params):
    gate_initializer = GateInitializerClustering(data_input.x_tr, params['gate_init_cluster_params'], n_dims=params['transform_params']['embed_dim'])
    gate_initializer.initialize_gates() 
    gate_initializer.construct_init_gate_tree()
    gate_initializer.plot_init_gate_tree_with_data()
    plt.savefig(os.path.join(params['save_dir'], 'init_gates.png'))
    plt.clf()

    return gate_initializer.init_gate_tree
Beispiel #2
0
def init_gates(data_input, params):
    gate_initializer = GateInitializerClustering(
        data_input.x_tr, params['gate_init_cluster_params'], n_dims=14)
    gate_initializer.initialize_gates()
    gate_initializer.construct_init_gate_tree()
    print(init_gates)
    return gate_initializer.init_gate_tree
def init_gates(data_input, params):
    gate_initializer = GateInitializerClustering(
        data_input.x_tr,
        params['gate_init_cluster_params'],
        n_dims=params['transform_params']['embed_dim'])
    gate_initializer.initialize_gates()
    gate_initializer.construct_init_gate_tree()
    return gate_initializer.init_gate_tree
Beispiel #4
0
def get_all_potential_gates(data_input, params):
    potential_gates = []
    for k in params['gate_init_cluster_params']['multi_k_init_values']:
        params_k = params['gate_init_cluster_params']
        params_k['n_clusters'] = k
        gate_initializer = GateInitializerClustering(
            data_input.x_tr,
            params_k,
            n_dims=params['transform_params']['embed_dim'])
        gate_initializer.initialize_gates()
        gate_initializer.construct_init_gate_tree()
        potential_gates.extend(gate_initializer.init_gate_tree)
    return potential_gates