mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-26 02:43:02 +00:00
contrastive: fix initial temperature value
It should be 1/0.07, but we had it set to 0.07......
This commit is contained in:
parent
f994d449f1
commit
1d872cb962
1 changed files with 3 additions and 1 deletions
|
@ -16,7 +16,9 @@ class LayerCheeseMultipleOut(tf.keras.layers.Layer):
|
||||||
self.param_batch_size = batch_size
|
self.param_batch_size = batch_size
|
||||||
self.param_feature_dim = feature_dim
|
self.param_feature_dim = feature_dim
|
||||||
|
|
||||||
self.weight_temperature = tf.Variable(name="loss_temperature", shape=1, initial_value=tf.constant([0.07]))
|
self.weight_temperature = tf.Variable(name="loss_temperature", shape=1, initial_value=tf.constant([
|
||||||
|
math.log(1 / 0.07)
|
||||||
|
]))
|
||||||
self.weight_nce = tf.Variable(
|
self.weight_nce = tf.Variable(
|
||||||
name="loss_nce",
|
name="loss_nce",
|
||||||
shape=(batch_size, feature_dim),
|
shape=(batch_size, feature_dim),
|
||||||
|
|
Loading…
Reference in a new issue