t-kalinowski / deep-learning-with-R-2nd-edition-code

Code from the book "Deep Learning with R, 2nd Edition"
https://blogs.rstudio.com/ai/posts/2022-05-31-deep-learning-with-r-2e/
54 stars 22 forks source link

Chapter 2.5.1 #2

Closed calmeidavieira closed 2 years ago

calmeidavieira commented 2 years ago

Hello,

Could you please check if you get same output for the following chunk of code (section 2.5.1)?

model <- naive_model_sequential(list(
   layer_naive_dense(input_size = 28 * 28, output_size = 512,
                     activation = tf$nn$relu),
   layer_naive_dense(input_size = 512, output_size = 10,
                     activation = tf$nn$softmax)
 ))

Error in random_array(w_shape, min = 0, max = 0.1) : could not find function "random_array"

Some additional information: R version 4.2.1 (2022-06-23 ucrt) Loaded Tensorflow version 2.9.1

Apologies if that was answered somewhere else and/of I missed to include add information.

Regards. Cicero

t-kalinowski commented 2 years ago

Welcome! :)

The random_array function is defined earlier in the chapter: https://github.com/t-kalinowski/deep-learning-with-R-2nd-edition-code/blob/9f8b6d08dbb8d6565e4f5396e509aaea3e242b84/ch02.R#L177-L179