# TensorFlow

### From charlesreid1

# Notes

## Google Cloud Data Engineering Certification Course

Building TensorFlow Models: GCDEC/Building_Tensorflow/Notes

Deploying TensorFlow Models: GCDEC/Deploying_Tensorflow/Notes

Engineering TensorFlow Models: GCDEC/Engineering_Tensorflow/Notes

# Example TensorFlow Networks

This section contains a list of TensorFlow networks that have writeups on the wiki.

## TensorFlow Models Repository

Writeups of models from https://github.com/tensorflow/models

### MNIST

TensorFlow/MNIST - illustrating a basic convolutional network to do handwritten digit classification

TensorFlow/MNIST2 - a more, uh, convoluted example of how to do convolutional neural networks (lower-level, manual initialization and layer assembly, etc.)

### Adversarial Neural Networks

TensorFlow/Adversarial Crypto - a triplet adversarial neural network configuration (encoder/decoder/eavesdropper networks corresponding to Alice/Bob/Eve).

### Research Networks

TensorFlow/Differential Privacy - a research neural network configuration intended to help protect the privacy of users in crowdsourced data sets. Main challenge is in minimizing a non-convex loss function.

# Usage and Components

## Command Line Arguments

TensorFlow/Command Line Args - notes on using command line arguments in TensorFlow models

## Projector

The embedding projector site is a page that uses (?) TensorFlow to create lower-dimensional visualizations from higher-dimensional data. There are several visualization options, including tSNE and PCA.

Link: http://projector.tensorflow.org/

## The Influence of Google Technologies

An interesting blog post that highlights the influence of Google Technologies on TensorFlow: http://planspace.org/20170313-tensorflow_use_of_google_technologies/

This includes:

- gflags
- apputils (now abseil)
- bazel
- protobuf
- grpc
- gemmlowp
- gfile

# Github

## My Repositories

## Other Repositories

### Official Repositories

- https://github.com/tensorflow/tensorflow - official TensorFlow repository

- https://github.com/tensorflow/models - models and examples built with TensorFlow
- contains models referenced by TensorFlow tutorials in the documentation: https://www.tensorflow.org/tutorials/
- a partial list of other models: imagenet, adversarial networks, OCR, autoencoders, compression, im2txt, inception, optimizer, GPU, streetview, video prediction

- https://github.com/GoogleCloudPlatform/training-data-analyst - models and examples for the TensorFlow section of the Google Cloud Data Engineering training
- relevant code is in courses/machine_learning/
- contains sequential buildup of a simple tensorflow example into a more complex tensorflow example in courses/machine_learning/tensorflow
- contains example bundled app for training/predictions using Cloud ML Engine in courses/machine_learning/cloudmle

- https://github.com/GoogleCloudPlatform/cloudml-samples - examples that demonstrate how to use Cloud ML Engine; this demonstrates multiple techniques:
- training a Keras model using Cloud ML Engine
- using "canned" TensorFlow estimator
- using custom TensorFlow estimator
- using low-level TensorFlow API
- both linear and deep models
- wide and deep network

- https://github.com/tensorflow/nmt - machine translation tutorial using TensorFlow

- https://github.com/tensorflow/k8s - tools for running TensorFlow using Kubernetes

- https://github.com/tensorflow/agents - agents provides examples of doing batch reinforcement learning in TensorFlow using agents

- https://github.com/tensorflow/tensorboard - TensorBoard is a visualization tool for TensorFlow

- https://github.com/tensorflow/transform - a library for doing transforms on input data for preprocessing (e.g., with Apache Beam)
- getting started guide: https://github.com/tensorflow/transform/blob/master/getting_started.md
- import the library as
`import tensorflow_transform as tft`

- define transforms as
`x_centered = x - tft.mean(x)`

, where x is a Tensor object - the preprocessing function is passed Tensors in batches, not individually; operations/functions are applied to single tensors at a time; these operations are then "broadcast" to the entire tensor

- https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/learn/python/learn - previously "skflow", this is a simplified, high-level interface to TensorFlow for learning
- documented here: https://www.tensorflow.org/api_docs/python/tf/contrib/learn
- also provides interfaces to Pandas dataframes (yay!)

### Other Repositories

- https://github.com/pdsmith1223/rntn - recurrent neural networks and recursive neural tensor networks

- https://github.com/ajschumacher/mapreduce_with_tensorflow - an unusual use of TensorFlow to perform MapReduce computations