Skip to content

Commit 1f81a5c

Browse files
Turgut AbdullayevTurgut Abdullayev
authored andcommitted
"dtype" before decoder
1 parent 506e4cf commit 1f81a5c

File tree

2 files changed

+3
-90
lines changed

2 files changed

+3
-90
lines changed

vignettes/examples/eager_cvae.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ encoder_model <- function(name = NULL) {
8686

8787
decoder_model <- function(name = NULL) {
8888
keras_model_custom(name = name, function(self) {
89-
self$dense <- layer_dense(units = 7 * 7 * 32, activation = "relu",dtype='float32')
89+
self$dense <- layer_dense(units = 7 * 7 * 32, activation = "relu")
9090
self$reshape <- layer_reshape(target_shape = c(7, 7, 32))
9191
self$deconv1 <-
9292
layer_conv_2d_transpose(
@@ -132,8 +132,8 @@ reparameterize <- function(mean, logvar) {
132132
# Loss and optimizer ------------------------------------------------------
133133

134134
normal_loglik <- function(sample, mean, logvar, reduce_axis = 2) {
135-
loglik <- k_constant(0.5, dtype = tf$float32) *
136-
(k_log(2 * k_constant(pi, dtype = tf$float32)) +
135+
loglik <- k_constant(0.5) *
136+
(k_log(2 * k_constant(pi)) +
137137
logvar +
138138
k_exp(-logvar) * (sample - mean) ^ 2)
139139
- k_sum(loglik, axis = reduce_axis)

vignettes/examples/load_GloVe.R

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)