# NOT RUN {
with(tensorflow::tf$variable_scope("examples",
reuse = tensorflow::tf$AUTO_REUSE
), {
totrain <- tensorflow::tf$get_variable(
"totrain",
tensorflow::shape(10L, 20L)
)
loss <- 2 * totrain
train_op <- create_optimizer(
loss = loss,
init_lr = 0.01,
num_train_steps = 20L,
num_warmup_steps = 10L,
use_tpu = FALSE
)
})
# }
Run the code above in your browser using DataLab