Torch Deep Learning Tutorial (i)

Source: Internet
Author: User
The goal of this blog is to introduce the introduction of torch

Bloggers use the Itorch interface to write, the following images to show the code.
If you can't remember the name of the method can be in the Itorch Point "tab" key will have intelligent input, similar to MATLAB

  • Simple Introduction to String,numbers,tables

The action of the string is a single quotation mark, and then the print () function in the second row is a bit like the cout in C + +, which can be displayed according to the type of input to be printed, the input string, followed by input to other data formats. Because the torch is interactive, and Matlab very much like so directly hit a can also show the output.

B is to declare an array type that is similar to an array, without assigning an initial value that appears empty when printed.

Assign a value to the array, the first array element is the string A, the second is integer 30, the same call to print () and a direct hit B, printing the same effect. It is important to note that the output here is printed together with the array sequence number and the set element.

Then take a look at a simple loop, this is the LUA array for loop, in the "#" to add the loop to use the array name, the default is the form of i++ loop, can be changed to i = i + 2 or other forms, concrete see experience

This is not a two-time printing element, so the first array element "Hello" and the third one should be printed, but the array has no third so the result is as


The above two graphs, should be able to better explain the cycle

Torch Deep Learning Tutorial (i)

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.