• TensorFlow for R


    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

    ---------------------------------------------------------------------------------- 数据和特征决定了效果上限,模型和算法决定了逼近这个上限的程度 ----------------------------------------------------------------------------------
  • 相关阅读:
    洛谷1462 通往奥格瑞玛的道路 二分+spfa
    NumPy 排序、条件刷选函数
    NumPy 统计函数
    2019-3-10——生成对抗网络GAN---生成mnist手写数字图像
    python if __name__ == 'main' 的作用和原理()
    Python os.getcwd()
    numpy.random.uniform()
    tf.trainable_variables()
    tf.layers.dense()
    彻底弄懂tf.Variable、tf.get_variable、tf.variable_scope以及tf.name_scope异同
  • 原文地址:https://www.cnblogs.com/payton/p/5927962.html
Copyright © 2020-2023  润新知