Tensorflow on ARC: Difference between revisions
m (Added categories) |
|||
Line 10: | Line 10: | ||
= Installing Tensorflow in your Home Directory = | = Installing Tensorflow in your Home Directory = | ||
=== Test script === | |||
<code>tensorflow-test.py</code>: | |||
<syntaxhighlight lang=python> | |||
#! /usr/bin/env python | |||
# ------------------------------------------ | |||
import os | |||
import tensorflow as tf | |||
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices' | |||
# ------------------------------------------ | |||
print("Define data:") | |||
node1 = tf.constant(3.0) | |||
node2 = tf.constant(4.0) | |||
print(node1, node2) | |||
# ------------------------------------------ | |||
print("Compute:") | |||
node3 = node1 + node2 | |||
print(node3, "=", float(node3)) | |||
# ------------------------------------------ | |||
</syntaxhighlight> | |||
= Requesting GPU Resources for Tensorflow Jobs = | = Requesting GPU Resources for Tensorflow Jobs = |
Revision as of 19:23, 31 January 2022
Introduction to Tensorflow
Tensorflow is a tool for evaluating dataflow graphs that represent both the computations and model state in a machine learning algorithm. It enables distributed evaluation and explicit communication across a large number of computing devices (e.g. numerous CPUs or GPUs). The core tools of tensorflow consist of shared C libraries for constructing dataflow graphs and executing computations (typically linear algebra on tensors). This constitutes a fairly low level language for setting up data preprocessing, model training, and inference infrastructure for online machine learning applications. For an overview of tensorflow's design principles and its relationship with other popular machine learning technologies (like Caffe, Torch, and MXNet), Abadi's 2016 article is a good starting point.
However, in its most common usage, Tensorflow's implementation of common deep neural network operations are exposed through the Python API. Direct access to all of this functionality from a C++ API is under development but most of the core deep neural network functionality that users are familiar with are still only available through specific client languages with Python being the most developed. The high-level Tensorflow API is consistent with the modelling standards established by Keras (that support multiple alternate backend evaluation engines). The higher level abstractions do not necessarily offer the same flexibility of parallel computation as the core Tensorflow tool. However, they generally are more accessible to users that are primarily familiar with the modelling techniques that are common to artificial neural networks. Consequently, Keras has been integrated directly into the core utility libraries of the Tensorflow Python API.
Tensorflow documentation and tutorials
Installing Tensorflow in your Home Directory
Test script
tensorflow-test.py
:
#! /usr/bin/env python
# ------------------------------------------
import os
import tensorflow as tf
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
# ------------------------------------------
print("Define data:")
node1 = tf.constant(3.0)
node2 = tf.constant(4.0)
print(node1, node2)
# ------------------------------------------
print("Compute:")
node3 = node1 + node2
print(node3, "=", float(node3))
# ------------------------------------------