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. 1137: 零起点学算法44——多组测试数据输出II

    1137: 零起点学算法44--多组测试数据输出II Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lldSubmitted: ...

  2. 深入Web请求过程

    B/S网络架构 带来的好处: 1.客户端使用同一的浏览器. --浏览器的交互特性使其使用起来非常简便 2.服务器基于统一的http.  --简化.规范开发模式,大大节省开发成本.如tomcat ngi ...

  3. Git托管

    前面的话 本文将主要介绍如何使用Github来托管Git服务 SSH 大多数Git服务器都会选择使用SSH公钥来进行授权.系统中的每个用户都必须提供一个公钥用于授权 首先先确认一下是否已经有一个公钥了 ...

  4. 跟着刚哥梳理java知识点——泛型(十三)

    一. 泛型概念的提出(为什么需要泛型)? 首先,我们看下下面这段简短的代码: public class GenericTest { public static void main(String[] a ...

  5. 初识ElasticSearch

    概述 Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功能最全的搜索引擎库. 分布式的 ...

  6. superslide2插件

    地址:http://www.superslide2.com/ 做自适应要注意该宽度和高度 等比缩放

  7. php 启动过程 - sapi MSHUTDOWN 过程

    php 启动过程 - sapi MSHUTDOWN 过程 概述 当服务器关闭时, 会走到 sapi MSHUTDOWN 过程 注册过程 本次内容是在 php 启动过程 - sapi MINIT 过程 ...

  8. extj6.0写增删查改(1)-------查询

    本文主要实现的效果是:点击查询按钮,根据form中的条件,在Grid中显示对应的数据(如果form为空,显示全部数据) 一.静态页面 1.查询按钮 { text:'查询', handler: 'onS ...

  9. LINUX下安装搭建nodejs及创建nodejs-express-mongoose项目

    在Ubuntu中按CTRL+ALT+T打开命令窗口,按下面步骤和命令进行安装即可.添加sublime text 3的仓库.1.sudo add-apt-repository ppa:webupd8te ...

  10. JavaScript巧学巧用

    关于 微信公众号:前端呼啦圈(Love-FED) 我的博客:劳卜的博客 知乎专栏:前端呼啦圈 前言 由于工作和生活上的一些变化,最近写文章的频率有点下降了,实在不好意思,不过相信不久就会慢慢恢复过来, ...