Skip to content

Commit

Permalink
TensorFlow: Upstream latest changes to Git.
Browse files Browse the repository at this point in the history
Changes:
- Updates to installation instructions.
- Updates to documentation.
- Minor modifications and tests for word2vec.

Base CL: 107284192
  • Loading branch information
keveman committed Nov 7, 2015
1 parent c19e4a1 commit f483e39
Show file tree
Hide file tree
Showing 73 changed files with 1,245 additions and 914 deletions.
61 changes: 60 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,66 @@ organization for the purposes of conducting machine learning and deep neural
networks research. The system is general enough to be applicable in a wide
variety of other domains, as well.

# Download and Setup

For detailed installation instructions, see
[here](g3doc/get_started/os_setup.md).

## Binary Installation

### Ubuntu/Linux

Make sure you have [pip](https://pypi.python.org/pypi/pip) installed:

```sh
$ sudo apt-get install python-pip
```

Install TensorFlow:

```sh
# For CPU-only version
$ sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# For GPU-enabled version
$ sudo pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
```

### Mac OS X

Make sure you have [pip](https://pypi.python.org/pypi/pip) installed:

If using `easy_install`:

```sh
$ sudo easy_install pip
```

Install TensorFlow (only CPU binary version is currently available).

```sh
$ sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
```

### Try your first TensorFlow program

```sh
$ python

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print sess.run(hello)
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print sess.run(a+b)
42
>>>

```


##For more information

* [Installation and setup instructions](/tensorflow/g3doc/get_started/os_setup.md)
* [TensorFlow website](http://tensorflow.org)
2 changes: 1 addition & 1 deletion tensorflow/core/framework/tensor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "tensorflow/core/framework/types.proto";
message TensorProto {
DataType dtype = 1;

// Shape of the tensor. TODO(mdevin): sort out the 0-rank issues.
// Shape of the tensor. TODO(touts): sort out the 0-rank issues.
TensorShapeProto tensor_shape = 2;

// Only one of the representations below is set, one of "tensor_contents" and
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/kernels/softmax_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct SoftmaxEigenImpl {
Eigen::IndexList<Eigen::type2index<1>, int> one_by_class;
one_by_class.set(1, num_classes);
#endif
// NOTE(mdevin): If you modify this implementation please run
// NOTE(touts): If you modify this implementation please run
// the ImageNetSoftmaxFwd benchmark in core_ops_test.cc.
//
// softmax = exp(logits - max(logits along classes));
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/kernels/xent_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct XentEigenImpl {
typename TTypes<T>::Matrix scratch,
typename TTypes<T>::Vec loss,
typename TTypes<T>::Matrix backprop) {
// NOTE(mdevin): This duplicates some of the computations in softmax_op
// NOTE(touts): This duplicates some of the computations in softmax_op
// because we need the intermediate (logits -max(logits)) values to
// avoid a log(exp()) in the computation of the loss.

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/lib/histogram/histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ThreadSafeHistogram {

void Clear();

// TODO(mdevin): It might be a good idea to provide a AddN(<many values>)
// TODO(touts): It might be a good idea to provide a AddN(<many values>)
// method to avoid grabbing/releasing the lock when adding many values.
void Add(double value);

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/public/tensor_shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TensorShape {

/// \brief Returns the number of elements in dimension "d".
/// REQUIRES: "0 <= d < dims()"
// TODO(mdevin): Rename to dimension() to match Eigen::Tensor::dimension()?
// TODO(touts): Rename to dimension() to match Eigen::Tensor::dimension()?
int64 dim_size(int d) const {
DCHECK_GE(d, 0);
DCHECK_LT(d, dims());
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/util/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ message Event {
// Timestamp of the event.
double wall_time = 1;

// Globale step of the event.
// Global step of the event.
int64 step = 2;

oneof what {
Expand Down
19 changes: 13 additions & 6 deletions tensorflow/examples/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ installed the NDK and SDK. Otherwise an error such as:
"The external label '//external:android/sdk' is not bound to anything" will
be reported.


To build the APK, run this from your workspace root:
```
bazel build //tensorflow/examples/android:tensorflow_demo -c opt --copt=-mfpu=neon
Expand All @@ -29,11 +28,19 @@ Note that "-c opt" is currently required; if not set, an assert (for an
otherwise non-problematic issue) in Eigen will halt the application during
execution. This issue will be corrected in an upcoming release.

If adb debugging is enabled on your device, you may instead use the following
command from your workspace root to automatically build and install:
If adb debugging is enabled on your Android 5.0 or later device, you may then
use the following command from your workspace root to install the APK once
built:
'''
adb install -r -g bazel-bin/tensorflow/examples/android/tensorflow_demo_incremental.apk
'''

Alternatively, a streamlined means of building, installing and running in one
command is:
```
bazel mobile-install //tensorflow/examples/android:tensorflow_demo -c opt --copt=-mfpu=neon
bazel mobile-install //tensorflow/examples/android:tensorflow_demo -c opt --start_app --copt=-mfpu=neon
```

Add the "--start_app" flag if you wish to automatically start the app after
installing. Otherwise, find the application icon labeled "Tensorflow Demo".
If camera permission errors are encountered (possible on Android Marshmallow or
above), then the adb install command above should be used instead, as it
automatically grants the required camera permissions with '-g'.
2 changes: 1 addition & 1 deletion tensorflow/g3doc/api_docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Over time, we hope that the TensorFlow community will develop front ends for
languages like Go, Java, Javascript, Lua R, and perhaps others. With SWIG, it's
relatively easy to contribute a TensorFlow interface to your favorite language.

Note: Many practical aspects of ssage are covered in the Mechanics tab, and
Note: Many practical aspects of usage are covered in the Mechanics tab, and
some additional documentation not specific to any particular language API is
available in the Resources tab.

4 changes: 4 additions & 0 deletions tensorflow/g3doc/api_docs/python/array_ops.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!-- This file is machine generated: DO NOT EDIT! -->

# Tensor Transformations

Note: Functions taking `Tensor` arguments can also take anything
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor).

<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
* [Casting](#AUTOGENERATED-casting)
Expand Down
5 changes: 3 additions & 2 deletions tensorflow/g3doc/api_docs/python/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ The operation that failed, if known.
or `Recv` op, there will be no corresponding
[`Operation`](framework.md#Operation) object. In that case, this
will return `None`, and you should instead use the
[`node_def`](OpError.node_def) to discover information about the op.
[`OpError.node_def`](#OpError.node_def) to discover information about the
op.

##### Returns:

Expand Down Expand Up @@ -536,7 +537,7 @@ The operation was aborted, typically due to a concurrent action.

For example, running a [`queue.enqueue()`](io_ops.md#QueueBase.enqueue)
operation may raise `AbortedError` if a
[`queue.close()`](io_ops.md@QueueBase.close) operation previously ran.
[`queue.close()`](io_ops.md#QueueBase.close) operation previously ran.

- - -

Expand Down
4 changes: 4 additions & 0 deletions tensorflow/g3doc/api_docs/python/constant_op.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!-- This file is machine generated: DO NOT EDIT! -->

# Constants, Sequences, and Random Values

Note: Functions taking `Tensor` arguments can also take anything
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor).

<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
* [Constant Value Tensors](#AUTOGENERATED-constant-value-tensors)
Expand Down
4 changes: 4 additions & 0 deletions tensorflow/g3doc/api_docs/python/control_flow_ops.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!-- This file is machine generated: DO NOT EDIT! -->

# Control Flow

Note: Functions taking `Tensor` arguments can also take anything
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor).

<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
* [Control Flow Operations](#AUTOGENERATED-control-flow-operations)
Expand Down
9 changes: 6 additions & 3 deletions tensorflow/g3doc/api_docs/python/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->

Import names from the framework library.
Classes and functions for building TensorFlow graphs.

## Core graph data structures <div class="md-anchor" id="AUTOGENERATED-core-graph-data-structures">{#AUTOGENERATED-core-graph-data-structures}</div>

Expand Down Expand Up @@ -126,6 +126,10 @@ with tf.Graph().as_default() as g:

Returns a serialized `GraphDef` representation of this graph.

The serialized `GraphDef` can be imported into another `Graph`
(using [`import_graph_def()`](#import_graph_def)) or used with the
[C++ Session API](../cc/index.md).

This method is thread-safe.

##### Args:
Expand All @@ -137,8 +141,7 @@ This method is thread-safe.

##### Returns:

A
[`GraphDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/graph.proto)
A [`GraphDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/graph.proto)
protocol buffer.


Expand Down
24 changes: 14 additions & 10 deletions tensorflow/g3doc/api_docs/python/image.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
<!-- This file is machine generated: DO NOT EDIT! -->

# Images

Note: Functions taking `Tensor` arguments can also take anything
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor).

<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
* [Encoding and Decoding.](#AUTOGENERATED-encoding-and-decoding.)
* [Encoding and Decoding](#AUTOGENERATED-encoding-and-decoding)
* [tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)](#decode_jpeg)
* [tf.image.encode_jpeg(image, format=None, quality=None, progressive=None, optimize_size=None, chroma_downsampling=None, density_unit=None, x_density=None, y_density=None, xmp_metadata=None, name=None)](#encode_jpeg)
* [tf.image.decode_png(contents, channels=None, name=None)](#decode_png)
* [tf.image.encode_png(image, compression=None, name=None)](#encode_png)
* [Resizing.](#AUTOGENERATED-resizing.)
* [Resizing](#AUTOGENERATED-resizing)
* [tf.image.resize_images(images, new_height, new_width, method=0)](#resize_images)
* [tf.image.resize_area(images, size, name=None)](#resize_area)
* [tf.image.resize_bicubic(images, size, name=None)](#resize_bicubic)
* [tf.image.resize_bilinear(images, size, name=None)](#resize_bilinear)
* [tf.image.resize_nearest_neighbor(images, size, name=None)](#resize_nearest_neighbor)
* [Cropping.](#AUTOGENERATED-cropping.)
* [Cropping](#AUTOGENERATED-cropping)
* [tf.image.resize_image_with_crop_or_pad(image, target_height, target_width)](#resize_image_with_crop_or_pad)
* [tf.image.pad_to_bounding_box(image, offset_height, offset_width, target_height, target_width)](#pad_to_bounding_box)
* [tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)](#crop_to_bounding_box)
* [tf.image.random_crop(image, size, seed=None, name=None)](#random_crop)
* [tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)](#extract_glimpse)
* [Flipping and Transposing.](#AUTOGENERATED-flipping-and-transposing.)
* [Flipping and Transposing](#AUTOGENERATED-flipping-and-transposing)
* [tf.image.flip_up_down(image)](#flip_up_down)
* [tf.image.random_flip_up_down(image, seed=None)](#random_flip_up_down)
* [tf.image.flip_left_right(image)](#flip_left_right)
* [tf.image.random_flip_left_right(image, seed=None)](#random_flip_left_right)
* [tf.image.transpose_image(image)](#transpose_image)
* [Image Adjustments.](#AUTOGENERATED-image-adjustments.)
* [Image Adjustments](#AUTOGENERATED-image-adjustments)
* [tf.image.adjust_brightness(image, delta, min_value=None, max_value=None)](#adjust_brightness)
* [tf.image.random_brightness(image, max_delta, seed=None)](#random_brightness)
* [tf.image.adjust_contrast(images, contrast_factor, min_value=None, max_value=None)](#adjust_contrast)
Expand All @@ -36,7 +40,7 @@

<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->

## Encoding and Decoding. <div class="md-anchor" id="AUTOGENERATED-encoding-and-decoding.">{#AUTOGENERATED-encoding-and-decoding.}</div>
## Encoding and Decoding <div class="md-anchor" id="AUTOGENERATED-encoding-and-decoding">{#AUTOGENERATED-encoding-and-decoding}</div>

TensorFlow provides Ops to decode and encode JPEG and PNG formats. Encoded
images are represented by scalar string Tensors, decoded images by 3-D uint8
Expand Down Expand Up @@ -211,7 +215,7 @@ the smallest output, but is slower.



## Resizing. <div class="md-anchor" id="AUTOGENERATED-resizing.">{#AUTOGENERATED-resizing.}</div>
## Resizing <div class="md-anchor" id="AUTOGENERATED-resizing">{#AUTOGENERATED-resizing}</div>

The resizing Ops accept input images as tensors of several types. They always
output resized images as float32 tensors.
Expand Down Expand Up @@ -376,7 +380,7 @@ Input images can be of different types but output images are always float.



## Cropping. <div class="md-anchor" id="AUTOGENERATED-cropping.">{#AUTOGENERATED-cropping.}</div>
## Cropping <div class="md-anchor" id="AUTOGENERATED-cropping">{#AUTOGENERATED-cropping}</div>

- - -

Expand Down Expand Up @@ -555,7 +559,7 @@ The argument `normalized` and `centered` controls how the windows are built:



## Flipping and Transposing. <div class="md-anchor" id="AUTOGENERATED-flipping-and-transposing.">{#AUTOGENERATED-flipping-and-transposing.}</div>
## Flipping and Transposing <div class="md-anchor" id="AUTOGENERATED-flipping-and-transposing">{#AUTOGENERATED-flipping-and-transposing}</div>

- - -

Expand Down Expand Up @@ -687,7 +691,7 @@ See also `transpose()`.



## Image Adjustments. <div class="md-anchor" id="AUTOGENERATED-image-adjustments.">{#AUTOGENERATED-image-adjustments.}</div>
## Image Adjustments <div class="md-anchor" id="AUTOGENERATED-image-adjustments">{#AUTOGENERATED-image-adjustments}</div>

TensorFlow provides functions to adjust images in various ways: brightness,
contrast, hue, and saturation. Each adjustment can be done with predefined
Expand Down
Loading

0 comments on commit f483e39

Please sign in to comment.