CoCalc Public Filesr-tensorflow.ipynbOpen with one click!
Author: Harald Schilly
Views : 81
Description: running tensorflow in R on cocalc
Compute Environment: Ubuntu 18.04 (Deprecated)

Tensorflow in R

In [1]:
version
_ platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 4.2 year 2017 month 09 day 28 svn rev 73368 language R version.string R version 3.4.2 (2017-09-28) nickname Short Summer
In [2]:
require(tensorflow) hello <- tf$constant('Hello, TensorFlow!') sess <- tf$Session() sess$run(tf$global_variables_initializer())
Loading required package: tensorflow
In [3]:
sess$run(hello)
'Hello, TensorFlow!'
In [4]:
a <- tf$constant(11.1) b <- tf$constant(3.3) sess$run(a + 2*b)
17.7000007629395
In [5]:
x <- tf$random_normal(shape(10, 10)) y <- sess$run(x) heatmap(as.matrix(y))
In [ ]: