Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keras 2.3.1 update #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ y_test = keras.utils.to_categorical( y_test )
# only select 100 training samples
idxs_annot = range( x_train.shape[0])
random.seed(0)
random.shuffle( idxs_annot )
#random.shuffle( idxs_annot ) #TypeError: 'range' object does not support item assignment
random.shuffle( list(idxs_annot) )
idxs_annot = idxs_annot[ :100 ]

x_train_unlabeled = x_train
Expand Down
5 changes: 3 additions & 2 deletions ladder_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def batch_normalization(batch, mean=None, var=None):


def add_noise( inputs , noise_std ):
return Lambda( lambda x: x + tf.random_normal(tf.shape(x)) * noise_std )( inputs )
return Lambda( lambda x: x + tf.random.normal(tf.shape(x)) * noise_std )( inputs )


def get_ladder_network_fc(layer_sizes=[784, 1000, 500, 250, 250, 250, 10],
Expand Down Expand Up @@ -137,7 +137,8 @@ def encoder(inputs, noise_std ):
tr_m.compile(keras.optimizers.Adam(lr=0.02 ), 'categorical_crossentropy', metrics=['accuracy'])

tr_m.metrics_names.append("den_loss")
tr_m.metrics_tensors.append(u_cost)
#tr_m.metrics_tensors.append(u_cost)
tr_m.metrics.append(u_cost)

te_m = Model(inputs_l, y_l)
tr_m.test_model = te_m
Expand Down