Learning notes TF050: TensorFlow source code parsing, tf050tensorflow

Source: Internet
Author: User
Tags define get

Learning notes TF050: TensorFlow source code parsing, tf050tensorflow

TensorFlow directory structure.

ACKNOWLEDGMENTS # TensorFlow version Declaration
ADOPTERS. md # list of people or organizations using TensorFlow
AUTHORS # official list of TensorFlow AUTHORS
BUILD
CONTRIBUTING. md # TensorFlow contribution Guide
ISSUE_TEMPLATE.md # submit the ISSUE Template
LICENSE # copyright LICENSE
README. md
RELEASE. md # change log of each RELEASE
WORKSPACE # configure the mobile Development Environment
Bower. BUILD
Configure
Models. BUILD
Tensorflow # main directory
Third_party # third-party libraries, including eigen3 (feature calculation, SVD, LU decomposition, etc.), gpus (cuda supported), hadoop, jpeg, llvm, py, and sycl
Tools # Build cuda support
Util

Tensorflow directory structure:

BUILD
_ Init _. py
C
Cc # example of using C ++ for training
Compiler
Contrib # encapsulate common functions together with advanced APIs
Core # C ++ implementation main directory
Examples # examples
G3doc # code documentation for C ++ and Python versions
Go
Java
Opensource_only # declare a directory
Python # main directory of Python implementation
Stream_executor # stream processing
Tensorboard # App, Web Support, and script support
Tensorflow. bzl
Tf_exported_symbols.lds
Tf_version_script.lds
Tools # miscellaneous tools
User_ops
Workspace. bzl

Contirb directory. Save common functions and encapsulate advanced APIs. Not officially supported. After the advanced API is complete, it is officially migrated to or removed from the core TensorFlow directory. Some packages have a more complete implementation in https://github.com/tensorflow/models.
Framework: many functions are defined here (get_varibles, get_global_step), and some deprecated functions are discarded or not recommended.
Layers: initializers. py, variable initialization function. Layers. py, layer operation and weight bias variable function. Optimizers. py, loss function and global_step tensor operation. Regularizers. py, with weight regularization function. Summaries. py. The summary operation is added to the function in the tf. GraphKeys. SUMMARIES collection.
Learn: Uses TensorFlow for advanced deep learning APIs, training models, evaluation models, reading batch processing data, and queue function API encapsulation.
Rnn: an additional RNN Cell, which improves the RNN hidden layer, including lw.blockcell, GRUBlockCell, FusedRNNCell, GridLSTMCell, and AttentionCellWrapper.
Seq2seq: Create a neural network seq2seq layer and loss function operations.
Slim: TensorFlow-Slim (TF-Slim), a lightweight library for defining, training, and evaluating TensorFlow complex models. TF-Slim can be freely combined with TensorFlow native functions and tf. contrib other packages. TF-Slim has been gradually migrated to the TensorFlow open-source Models, which is widely used by convolutional neural network image classification Models. You can start to fine-tune the training model or prediction training model from the beginning.

Core directory. C language file, the original implementation of TensorFlow.

BUILD
Common_runtime # public Runtime Library
Debug
Ditributed_runtime # distributed execution module, including grpc session, grpc worker, and grpc master
Example
Framework # basic function module
Graph
Kernels # core operations are implemented in the CPU and CUDA Kernel
Lib # public base library
Ops
Platform # operating system implementation related files
Protobuf #. proto file, used for structural serialization during transmission
Public # API header file directory
User_ops
Util
Protocol Buffers, a data serialization tool created by Google, structured data serialization, data storage, or RPC data exchange format. Define the Protocol buffer to generate. pb. h and. pb. cc files. Define get, set, serialization, and deserialization functions. The TensorFlow core proto files graph_def.proto, node_def.proto, and op_def.proto are stored in the framework directory. Graph_def is built and stored in the graph, and then converted into a graph, node, and Operation memory object during actual computation.
Tensorflow-1.1.0/tensorflow/core/framework/node_def.proto, define the proto file. Node_def.proto defines the device operation (op) and Operation attribute (attr ).
The framework directory also contains node_def_builder.h, node_def_builder.cc, node_def_util.h, and node_def_util_test.cc. Operate the protobuf structure of node_def.proto in C ++.

Examples directory, deep learning example, MNIST, Word2vec, Deepdream, Iris, HDF5. TensorFlow is implemented on the Mobile End of the Android system. Extension. ipynb document tutorial, opened by jupyter.

G3doc. Stores TensorFlow documents and offline manuals maintained by Markdown. The content in the g3doc/api_docs directory is generated from the code annotation and cannot be edited directly. Script tools/docs/gen_docs.sh to generate the API documentation. If there is no parameter call, only the Python API documentation and operation documentation will be regenerated, including Python and C ++ definitions. Pass-a and run the script to generate the C ++ API document again. You need to install doxygen. It must be called from the tools/docs directory.

Python directory. Activate functions, convolution functions, pooled functions, loss functions, and optimization methods.

Tensorboad directory. The code of the TensorFlow chart visualization tool is implemented, and the code is visualized on the webpage based on Tornado. Http://www.tornadoweb.org/en/stable.

TensorFlow source code learning method.
1) understand basic fields of your own research, image classification, object detection, speech recognition, technologies used in the field, convolutional neural network, CNN), recurrent neural network (RNN), know the basic principles of implementation.
2) run the basic model corresponding to GitHub. The directory structure is as follows:

AUTHORS
CONTRIBTING. md
LICENSE
README. md
WORKSPACE
Autoencoder
Compression
Differential_privacy
Im2txt
Inception
Lm_1b
Namignizer
Neural_gpu
Neural_programmer
Next_frame_prdiction
Resnet
Slim
Street
Swivel
Syntaxnet
Textsum
Transformer
Tutorials
Video_prediction
Computer Vision, compression (image compression), im2txt (image description), inception (Inception V3 architecture training evaluation for ImageNet datasets), resnet (residual network), and slim (image classification) street (Road Sign Recognition or verification code recognition ).
Natural Language Processing, lm_1b (Language Model), namignizer (name), swivel (Swivel algorithm converts word vectors), syntaxnet (Word Segmentation and syntax analysis), textsum (text summarization), tutorials directory word2vec (word conversion vector ).
Textbook-style code, understanding and understanding can help you implement models by yourself in the future. Run the model, debug, and adjust parameters. After reading the entire project logic of MNIST or CIFAR10, you can master the TensorFlow project architecture.
Slim directory. TF-Slim image classification library. Defines, trains, and evaluates lightweight advanced APIs for complex models. Training, evaluation lenet, alexnet, vgg, inception_v1, inception_v2, inception_v3, inception_v4, resnet_v1, and resnet_v2. The model is located in slim/nets:

Alexnet. py
Alexnet_test.py
Cifarnet. py
Inception. py
Inception_resnet_v2.py
Inception_resnet_v2_test.py
Inception_utils.py
Inception_v1.py
Inception_v1_test.py
Inception_v2.py
Inception_v2_test.py
Inception_v3.py
Inception_v3_test.py
Inception_v4.py
Inception_v4_test.py
Lenet. py
Nets_factory.py
Nets_factory_test.py
Overfeat. py
Overfeat_test.py
Resnet_utils.py
Resnet_v1.py
Resnet_v1_test.py
Resnet_v2.py
Resnet_v3_test.py
Vgg. py
Vgg_test.py
TF-Slim contains scripts to train models from scratch or to train models and fine-tune models from a pre-trained network. slim/scripts:

Finetune_inception_v1_on_flowers.sh
Finetune_inception_v3_on_flowers.sh
Train_cifarnet_on_cifar10.sh
Train_lenet_on_mnist.sh
TF-Slim includes downloading standard image sets and converting TensorFlow supports TFRecords scripts. slim/datasets:

Cifar10.py
Dataset_factory.py
Dataset_utils.py
Download_and_convert_cifar10.py
Download_and_convert_flowers.py
Download_and_convert_mnist.py
Flowers. py
Imagenet. py
Mnist. py
3) find related papers based on the project to be done, and use TensorFlow to implement the thesis content. Qualitative leap.

References:
Analysis and Practice of TensorFlow Technology

Welcome to paid consultation (150 RMB per hour), My: qingxingfengzi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.