TensorFlow™ is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API.

The TensorFlow API is composed of a set of Python modules that enable constructing and executing TensorFlow graphs. The tensorflow package provides access to the complete TensorFlow API from within R.

Installing TensorFlow

You can install the main TensorFlow distribution from here:

https://www.tensorflow.org/get_started/os_setup.html#download-and-setup

NOTE: You should NOT install TensorFlow with Anaconda as there are issues with the way Anaconda builds the python shared library that prevent dynamic linking from R.

If you install TensorFlow within a Virtualenv environment you'll need to be sure to use that same environment when installing the tensorflow R package (see below for details).

Installing the R Package

If you installed TensorFlow via pip with your system default version of python then you can install the tensorflow R package as follows:

devtools::install_github("rstudio/tensorflow")

If you are using a different version of python for TensorFlow, you should set the TENSORFLOW_PYTHON environment variable to the full path of the python binary before installing, for example:

Sys.setenv(TENSORFLOW_PYTHON="/usr/local/bin/python")
devtools::install_github("rstudio/tensorflow")

If you only need to customize the version of python used (for example specifing python 3 on an Ubuntu system), you can set theTENSORFLOW_PYTHON_VERSION environment variable before installation:

Sys.setenv(TENSORFLOW_PYTHON_VERSION = 3)
devtools::install_github("rstudio/tensorflow")

Verifying Installation

You can verify that your installation is working correctly by running this script:

library(tensorflow)
sess = tf$Session()
hello <- tf$constant('Hello, TensorFlow!')
sess$run(hello)

Documentation

See the package website for additional details on using the TensorFlow API from R: https://rstudio.github.io/tensorflow

See the TensorFlow API reference for details on all of the modules, classes, and functions within the API:https://www.tensorflow.org/api_docs/python/index.html

The tensorflow package provides code completion and inline help for the TensorFlow API when running within the RStudio IDE. In order to take advantage of these features you should also install the current Preview Release of RStudio.

转自:https://github.com/rstudio/tensorflow?utm_source=tuicool&utm_medium=referral

TensorFlow for R的更多相关文章

  1. R用户的福音︱TensorFlow:TensorFlow的R接口

    ------------------------------------------------------------ Matt︱R语言调用深度学习架构系列引文 R语言︱H2o深度学习的一些R语言实 ...

  2. sparklyr包:实现Spark与R的接口+sparklyr 0.5

    本文转载于雪晴数据网 相关内容: sparklyr包:实现Spark与R的接口,会用dplyr就能玩Spark Sparklyr与Docker的推荐系统实战 R语言︱H2o深度学习的一些R语言实践-- ...

  3. mxnet:结合R与GPU加速深度学习

    转载于统计之都,http://cos.name/tag/dmlc/,作者陈天奇 ------------------------------------------------------------ ...

  4. R︱并行计算以及提高运算效率的方式(parallel包、clusterExport函数、SupR包简介)

    要学的东西太多,无笔记不能学~~ 欢迎关注公众号,一起分享学习笔记,记录每一颗"贝壳"~ --------------------------- 终于开始攻克并行这一块了,有点小兴 ...

  5. R语言︱H2o深度学习的一些R语言实践——H2o包

    每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- R语言H2o包的几个应用案例 笔者寄语:受启发 ...

  6. 碎片︱R语言与深度学习

    笔者:受alphago影响,想看看深度学习,但是其在R语言中的应用包可谓少之又少,更多的是在matlab和python中或者是调用.整理一下目前我看到的R语言的材料: ---------------- ...

  7. windows 安装tensorflow

    原文知乎:https://zhuanlan.zhihu.com/p/25778703 前言 看到Rstudio中开始支持Tensorflow,本人是欣喜若狂的,同时TensorFlow官网从16年9月 ...

  8. TensorFlow精选Github开源项目

    转载于:http://www.matools.com/blog/1801988 TensorFlow源码 https://github.com/tensorflow/tensorflow 基于Tens ...

  9. Awesome TensorFlow

    Awesome TensorFlow  A curated list of awesome TensorFlow experiments, libraries, and projects. Inspi ...

随机推荐

  1. ios animation 动画效果实现

    1.过渡动画 CATransition CATransition *animation = [CATransition animation]; [animation setDuration:1.0]; ...

  2. 字典树 Trie树

    什么是Trie树? 形如 其中从根节点到红色节点的路径上的字母所连成的字符串即为一个Trie树上所存的字符串. 比如,这个trie树上有ab,abc,bd,dda这些字符串. 至于怎么构建和查找或添加 ...

  3. Java 别名(Aliasing)

    别名 (Aliasing) 别名,顾名思义,是有别于现在名字的另一个名字,但指的是不是同一个人或事物呢?比如,你上学的时候同学有没有给你起什么外号?如果有的话,你的名字和同学给你起的外号是不是都指的是 ...

  4. 关于iOS开发首次进入需要获取地理位置

    今天给大家简单介绍一下iOS开发过程中会遇到的获取地理位置的问题,(话不多说进入正题)这里给大家讲解一下两种在APPdelegate获取地理位置的方法: 一:首先是用系统的方法获取地理位置: 1. 首 ...

  5. Lambda表达式效率问题

    原文 http://www.importnew.com/17262.html 有许许多多关于 Java 8 中流效率的讨论,但根据 Alex Zhitnitsky 的测试结果显示:坚持使用传统的 Ja ...

  6. .net 做工作流时,生成项目后工具箱里有关工作流的东西不显示解决方法

    在做工作流模块时,遇到一个比较棘手的问题,那就是生成项目后工具箱里有关工作流的东西不显示,这个问题令人百思不得其解,经过查阅英文网站,终于找到解决方法: 把项目中的建模项目移除掉,再重新生成,奇迹出现 ...

  7. eclipse--java工程转web工程 以及 java或java web工程转maven工程

    1.  打开工程文件夹,编辑工程的.project文件. 在<natures></natures>中加入 <nature>org.eclipse.wst.commo ...

  8. TreeSet对非自然顺序元素的排序

    /* 1. 往TreeSet添加元素的时候,如果元素本身具备了自然顺序的特性,那么就按照元素自然顺序的特性进行排序存储. 2. 往TreeSet添加元素的时候,如果元素本身不具备自然顺序的特性,那么该 ...

  9. Jfinal数据库操作语句中占位符的使用

    占位符的优点: 1.增加SQL代码可读性 2.占位符可以预先编译,提高执行效率 3.防止SQL注入 4.用占位符的目的是绑定变量,这样可以减少数据SQL的硬解析,所以执行效率会提高不少 假设要将id从 ...

  10. Docker - 导出导入容器

    导出和导入容器 使用docker export命令可以将本地容器导出为容器快照文件. 使用docker import命令可以将容器快照文件导入到本地镜像库,也可以通过指定URL或者某个目录来导入. 特 ...