


The concept and installation of TensorFlow, a deep learning framework
On November 9, 2015, Google released the artificial intelligence system TensorFlow and announced it as open source.
1. The concept of TensorFlow
TensorFlow is an open source software library that uses data flow graphs for numerical calculations. In other words, TensorFlow uses graphs to represent computing tasks. The nodes in the graph represent mathematical operations, and the edges represent multi-dimensional arrays (that is, tensors) used to communicate between operations. TensorFlow's flexible architecture allows you to deploy computing processes to one or more CPUs or GPUs.
TensorFlow was originally developed by researchers and engineers from the Google Brain Team and is primarily used by Google's Machine Intelligence research organization for machine learning and deep neural network research, but the system is also general in many other fields. .
#The abstract representation of the model is automatically handled by the framework, which makes TensorFlow and Theano particularly suitable for developing new models based on gradient optimization algorithms.
The main disadvantage of Theano is the long compilation time of the above symbolic model, and TensorFlow effectively improves this, that is, the compilation time is shorter.
Another advantage of TensorFlow is its supporting tool-TensorBoard, which visualizes the training process of the model. In this way, users can interactively examine the structure of the model and observe changes in parameters and model performance.
The open source version of TensorFlow can only run on one machine, but it supports parallel computing on multiple processors (CPUs or GPUs).
1.1 What is a data flow diagram?
Data flow diagrams use directed graphs to describe mathematical calculations, with points and edges in the graph.
Nodes usually perform mathematical calculations, but can also serve as endpoints to represent results, or read/write persistent variables.
Edges are used to describe the input/output relationships between nodes. These edges carry multidimensional arrays or tensors of variable size.
These nodes are assigned to computing devices and executed asynchronously. Once all tensors arrive at the same time, parallel calculations will be performed.
Due to the flow of tensors in the graph, we call it TensorFlow.
1.2 Features of TensorFlow
Deep Flexibility, flexibility. TensorFlow is not a rigid neural network library. As long as you can express your calculation process as a data flow graph, you can use TensorFlow. Defining a new calculation is as simple as writing a Python function and the cost is not high. If you can't see the underlying data operations you need, you can add them through C++.
True Portability, portability. TensorFlow runs on a CPU or GPU and can run on a laptop, server, or mobile computing platform. Models can be trained on mobile devices without special hardware or code changes, and computing can be performed on the cloud by encapsulating Docker and TensorFlow.
Connect Research and Production, both academic and industrial. At Google, scientists use TensorFlow to test new algorithms, and product teams use TensorFlow to train models to serve users.
Auto-Differentiation, automatic identification. TensorFlow's automatic discrimination capabilities are beneficial for implementing gradient-based machine learning algorithms. When you use TensorFlow, you define the calculation framework structure for your prediction model, plus the objective function. Then you only need to add data, and TensorFlow will calculate the derivative, that is, the gradient for you.
Language Options, language selection. TensorFlow can use the Python interface and the simple C++ interface to build and execute your computational graphs. If you are interested, you can also provide an interface in your favorite language - Lua, JavaScript, or R, etc.
Maximize Performance, maximize performance. TensorFlow allows you to take full advantage of the hardware you have available: 32 CPU cores and 4 GPU cards, threads, queues, asynchronous calculations, etc. You can freely allocate the computing elements in the TensorFlow graph to different devices and let TensorFlow handle them.
1.3 Who can use TensorFlow?
Students, researchers, enthusiasts, hackers, engineers, developers, inventors, innovators and more.
TensorFlow is currently not complete and it needs to be extended. Google only gave an initial version of the source code, and they hope to build an active open source community to make TensorFlow better and better.
Companies currently using TensorFlow include: Google, Uber, Twitter, DeepMind, JD.com, etc.
1.4 Why does Google open source TensorFlow?
"TensorFlow" is Google's internal machine learning system for many years. Today, Google is making this system an open source system and publishing the parameters of this system to industry engineers, scholars, and technicians with a large number of programming capabilities. What does this mean?
The answer is simple: Google believes that machine learning is a key component of future innovation. Research in this field is global and developing rapidly, but there is a lack of standard tools. Google engineers are using TensorFlow to develop user-oriented products and services. Google's research team also plans to share the implementation process of TensorFlow. They hope that TensorFlow can become one of the best tools for machine learning.
To use an inappropriate metaphor, Google’s current treatment of the TensorFlow system is somewhat similar to its treatment of its mobile operating system Android. If more data scientists start using Google's systems to conduct machine learning research, it will help Google gain more dominance over the growing machine learning industry.
1.5 TensorFlow and Computational Biology
There is a prerequisite for using current deep learning methods: having a data set with many samples.
Like identifying genes or methylation probes related to specific diseases, the sample set is very small, so it cannot be analyzed with deep learning. [Crying... I just want to use deep learning to identify disease genes...]
If you want to use a deep learning model, the first step is to solve the problem of how to represent the data. Such as: splice junctions, RNA-protein binding sites, or methylation. In other words, the number of your samples far exceeds the number of variables.
So, as long as this critical step is solved, TensorFlow will open the door to deep learning for you.
2. Tensorflow installation (based on pip)
Pip is a Python software package installation and management tool. Moreover, Tensorflow can only be installed in a Linux environment. For details on installing a Linux system under VMware, please refer to my other blog.
2.1 Install pip (need to install under super administrator privileges)
- ##sudo apt-get install python-pip python-dev
- sudo pip install --upgrade https:
//storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
##2.3 Test
- >>>
- import tensorflow
as tf
##>>> hello = tf. constant - (
'Hello, TensorFlow!')##> ;>> sess = tf.
Session ( - )
#>>> print sess.
run (hello - )
##Hello, TensorFlow !
official website and install it according to the steps of the official website tutorial.
Note: You can download it directly from the browser in Linux.
First, copy the file to the location where you want to install it./home/andy
Then unzip the file:
2016.3.
tar.Open the directory where the pycharm.sh file is located:
cd pycharm-community-2016.3/bin
Run the pycharm.sh file to install pycharm:
- ##./pycharm.
sh
After installation, pycharm will automatically open, and then a series of settings will be made:
When the following interface appears, the installation is successful.Select "Create New Project" to create a new project. The default compiler is python 2.7.
Then right-click on the newly created project and select "New->Python File" to create a new python file Py01.
Write a piece of code in the file Py01 for testing.
It can be seen that the test results are correct and you can import tensorflow on Pycharm!
2.5 Lock Pycharm to the launcher
Under Ubuntu, you need to find the folder where pycharm.sh is located every time and execute ./pycharm. sh, opening pycharm is very troublesome. So, we'd better create a shortcut. Ubuntu shortcuts are placed under "Computer/usr/share/applications". First create a Pycharm.desktop in this directory:sudo gedit- /usr/share
- /applications/
Pycharm.desktop
Then enter the following content. Note that Exec and Icon need to find the correct ones in your own computer. You also need to determine the version number of Pycharm in the path, GenericName and Comment according to the actual situation:
- [
- Desktop
Entry]
##Type= Application -
Name=
Pycharm -
GenericName=
Pycharm2017 -
Comment=
Pycharm2017 - :The
Python IDE##Exec=
"/home/wangfang/Pycham/pycharm-community-2017.1.3/bin/pycharm.sh" %f -
Icon=
/home/wangfang/Pycham /pycharm-community-2017.1.3/ - bin/pycharm.
pngTerminal=pycharm
##Categories=Pycharm;
After saving, you can find the corresponding desktop Pycharm.desktop file through the path /usr/share/applications/, then double-click to open it, and then lock it to the launcher.
Reference:
TensorFlow official website
Geek Academy—TensorFlow official document Chinese version
Geek Academy—Download and Installation
Geek Academy—MNIST Machine Learning Getting Started (Building a Softmax Regression Model)
Geek Academy - In-depth MNIST (Building a Deep Convolutional Neural Network)
Ladislav Rampasek and Anna Goldenberg, TensorFlow: Biology's Gateway to Deep Learning?
werm520's column: Installing PyCharm on Ubuntu
Installing Anaconda under Ubuntu
Installing Anaconda and Spyder under Linux (Ubuntu14.04)
How to install TensorFlow under Ubuntu
The above is the detailed content of The concept and installation of TensorFlow, a deep learning framework. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Evaluating the cost/performance of commercial support for a Java framework involves the following steps: Determine the required level of assurance and service level agreement (SLA) guarantees. The experience and expertise of the research support team. Consider additional services such as upgrades, troubleshooting, and performance optimization. Weigh business support costs against risk mitigation and increased efficiency.

The learning curve of a PHP framework depends on language proficiency, framework complexity, documentation quality, and community support. The learning curve of PHP frameworks is higher when compared to Python frameworks and lower when compared to Ruby frameworks. Compared to Java frameworks, PHP frameworks have a moderate learning curve but a shorter time to get started.

According to benchmarks, for small, high-performance applications, Quarkus (fast startup, low memory) or Micronaut (TechEmpower excellent) are ideal choices. SpringBoot is suitable for large, full-stack applications, but has slightly slower startup times and memory usage.

The lightweight PHP framework improves application performance through small size and low resource consumption. Its features include: small size, fast startup, low memory usage, improved response speed and throughput, and reduced resource consumption. Practical case: SlimFramework creates REST API, only 500KB, high responsiveness and high throughput

Writing clear and comprehensive documentation is crucial for the Golang framework. Best practices include following an established documentation style, such as Google's Go Coding Style Guide. Use a clear organizational structure, including headings, subheadings, and lists, and provide navigation. Provides comprehensive and accurate information, including getting started guides, API references, and concepts. Use code examples to illustrate concepts and usage. Keep documentation updated, track changes and document new features. Provide support and community resources such as GitHub issues and forums. Create practical examples, such as API documentation.

Choose the best Go framework based on application scenarios: consider application type, language features, performance requirements, and ecosystem. Common Go frameworks: Gin (Web application), Echo (Web service), Fiber (high throughput), gorm (ORM), fasthttp (speed). Practical case: building REST API (Fiber) and interacting with the database (gorm). Choose a framework: choose fasthttp for key performance, Gin/Echo for flexible web applications, and gorm for database interaction.

Java framework learning roadmap for different fields: Web development: SpringBoot and PlayFramework. Persistence layer: Hibernate and JPA. Server-side reactive programming: ReactorCore and SpringWebFlux. Real-time computing: ApacheStorm and ApacheSpark. Cloud Computing: AWS SDK for Java and Google Cloud Java.

There are five misunderstandings in Go framework learning: over-reliance on the framework and limited flexibility. If you don’t follow the framework conventions, the code will be difficult to maintain. Using outdated libraries can cause security and compatibility issues. Excessive use of packages obfuscates code structure. Ignoring error handling leads to unexpected behavior and crashes.
