Created
July 30, 2018 12:31
-
-
Save wehlutyk/7bc94f82421a61b7434718a4528e97d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nw2vec/ae.py b/nw2vec/ae.py | |
index 0488548..1fbb469 100644 | |
--- a/nw2vec/ae.py | |
+++ b/nw2vec/ae.py | |
@@ -483,18 +483,19 @@ def build_p_builder(dims, use_bias=False): | |
p_adj = layers.Bilinear(0, use_bias=use_bias, | |
kernel_regularizer='l2', bias_regularizer='l2', | |
name='p_adj')([p_layer1, p_layer1]) | |
- p_v_μ_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
- kernel_regularizer='l2', bias_regularizer='l2', | |
- name='p_v_mu_flat')(p_layer1) | |
- p_v_logD_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
- kernel_regularizer='l2', bias_regularizer='l2', | |
- name='p_v_logD_flat')(p_layer1) | |
- p_v_u_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
- kernel_regularizer='l2', bias_regularizer='l2', | |
- name='p_v_u_flat')(p_layer1) | |
- p_v_μlogDu_flat = keras.layers.Concatenate(name='p_v_mulogDu_flat')( | |
- [p_v_μ_flat, p_v_logD_flat, p_v_u_flat]) | |
- return ([p_adj, p_v_μlogDu_flat], ('SigmoidBernoulliAdjacency', 'Gaussian')) | |
+ # p_v_μ_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
+ # kernel_regularizer='l2', bias_regularizer='l2', | |
+ # name='p_v_mu_flat')(p_layer1) | |
+ # p_v_logD_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
+ # kernel_regularizer='l2', bias_regularizer='l2', | |
+ # name='p_v_logD_flat')(p_layer1) | |
+ # p_v_u_flat = keras.layers.Dense(dim_data, use_bias=use_bias, | |
+ # kernel_regularizer='l2', bias_regularizer='l2', | |
+ # name='p_v_u_flat')(p_layer1) | |
+ # p_v_μlogDu_flat = keras.layers.Concatenate(name='p_v_mulogDu_flat')( | |
+ # [p_v_μ_flat, p_v_logD_flat, p_v_u_flat]) | |
+ # return ([p_adj, p_v_μlogDu_flat], ('SigmoidBernoulliAdjacency', 'Gaussian')) | |
+ return ([p_adj], ('SigmoidBernoulliAdjacency',)) | |
return p_builder | |
diff --git a/projects/scale/blogcatalog.py b/projects/scale/blogcatalog.py | |
index bec7341..863034a 100644 | |
--- a/projects/scale/blogcatalog.py | |
+++ b/projects/scale/blogcatalog.py | |
@@ -26,7 +26,8 @@ dim_l1, dim_ξ = 10, 10 | |
use_bias = False | |
# Training | |
-loss_weights = [1.0, 1.0, 1.0] # q, p_adj, p_v | |
+# loss_weights = [1.0, 1.0, 1.0] # q, p_adj, p_v | |
+loss_weights = [1.0, 1.0] # q, p_adj | |
n_epochs = 10000 | |
# seeds_per_batch = len(nodes) -> defined below | |
max_walk_length = 1 | |
@@ -114,6 +115,7 @@ dims = (dim_data, dim_l1, dim_ξ) | |
DATA_PARAMETERS = 'crop={crop}'.format(crop=crop) | |
VAE_PARAMETERS = ( | |
'no_adj_cross_entropy_weighing' | |
+ '-no_feature_reconstruction' | |
'-n_ξ_samples={n_ξ_samples}' | |
'-dims={dims}' | |
'-bias={use_bias}').format(n_ξ_samples=n_ξ_samples, | |
@@ -173,7 +175,7 @@ def target_func(batch_adj, required_nodes, final_nodes): | |
0, n_ξ_samples), | |
0, 1 | |
), | |
- utils.expand_dims_tile(features[final_nodes], 1, n_ξ_samples), | |
+ # utils.expand_dims_tile(features[final_nodes], 1, n_ξ_samples), | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment