Commit ed3b7821 authored by lucas_miranda's avatar lucas_miranda
Browse files

Implemented weight saving callback in model_training.py

parent fdbfbb65
......@@ -6,7 +6,7 @@ from tensorflow.keras import Input, Model, Sequential
from tensorflow.keras.activations import softplus
from tensorflow.keras.callbacks import LambdaCallback
from tensorflow.keras.constraints import UnitNorm
from tensorflow.keras.initializers import he_uniform, Orthogonal
from tensorflow.keras.initializers import he_uniform, Orthogonal, RandomNormal
from tensorflow.keras.layers import BatchNormalization, Bidirectional
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.layers import RepeatVector, Reshape, TimeDistributed
......@@ -301,7 +301,9 @@ class SEQ_2_SEQ_GMVAE(HyperModel):
z_cat = Dense(
self.number_of_components,
activation="softmax",
kernel_initializer=Constant(value=1 / self.number_of_components),
kernel_initializer=RandomNormal(
mean=(1 / self.number_of_components), stddev=0.05, seed=None
),
)(encoder)
z_gauss = Dense(
tfpl.IndependentNormal.params_size(ENCODING * self.number_of_components),
......
......@@ -5,7 +5,7 @@ from tensorflow.keras import Input, Model, Sequential
from tensorflow.keras.activations import softplus
from tensorflow.keras.callbacks import LambdaCallback
from tensorflow.keras.constraints import UnitNorm
from tensorflow.keras.initializers import Constant, he_uniform, Orthogonal
from tensorflow.keras.initializers import he_uniform, Orthogonal, RandomNormal
from tensorflow.keras.layers import BatchNormalization, Bidirectional
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.layers import RepeatVector, Reshape, TimeDistributed
......@@ -287,7 +287,9 @@ class SEQ_2_SEQ_GMVAE:
z_cat = Dense(
self.number_of_components,
activation="softmax",
kernel_initializer=Constant(value=1 / self.number_of_components),
kernel_initializer=RandomNormal(
mean=(1 / self.number_of_components), stddev=0.05, seed=None
),
)(encoder)
z_gauss = Dense(
tfpl.IndependentNormal.params_size(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment