"Compiling" in the Nnet3 configuration

Source: Internet
Author: User

The compilation process takes nnet and computationrequest as inputs and outputs nnetcomputation. The computationrequest contains a representation of the output index of the request, the available input index.

Create a calculation diagram

More about Computationgraph

computationgraph maps cindexes to cindex_ids and maps cindex_ids to cindexes.

The computationgraph class is defined as follows:

struct Computationgraph {

The mapping of cindex_id to CIndex.

Std::vector<cindex> cindexes;

For each CIndex this tells us whether it is provided as an input to the

Computation.

Std::vector<bool> Is_input;

DEPENDENCIES[CINDEX_ID] gives you, the list of other cindex_ids.

Particular cindex_id directly depends on to compute it.

std::vector<std::vector<int32> > dependencies;

Private

Maps each cindex to an integer cindex_id:reverse mapping of "cindexes".

Must be accessed via the GETCINDEXID () function.

Unordered_map<cindex, Int32, Cindexhasher> cindex_to_cindex_id_;

};

In addition to the above mappings,computationgraph also preserves the dependencies that each cindex_id needs to compute.

At the beginning of the calculation,descriptor::getdependencies () returns all the Cindex_ids, that is, each cindex_id is dependent on all other cindex_ IDS.

These dependencies are then trimmed according to the requirements of the actual calculation.

Build Computationgraph

Introduced

Computationgraphbuilder is used to build computationgraph. For one of the simplest examples, start with the output from the network request and compute its dependencies forward along the network and add it to the computationgraph until the input node is computed.

Determines whether the computationrequest contains the input nodes on which it is dependent, and if not enough, it cannot be evaluated. (At the 841 Institute Internship, after adding an output layer for an existing DNN , the script concludes that it cannot be calculated, which is dependent on this).

Basic algorithm

This algorithm is not actually used.

When building a calculation diagram, you need to use the following algorithm to determine whether each CIndex can be computed from the input provided:

    • Call descriptor::getdependencies () to get all the dependencies at the output layer;
    • Call iscomputable () to determine which cindexes in the input can be used for calculations and trim dependencies that do not actually participate in the calculation
    • Check that the output of all requests is computable
    • Pedicure off all cindex_ids that do not need to participate in the calculation

Organize your calculations into multi-step

CIndex are sorted and grouped according to the topological order, so that the same group of cindexes can be computed simultaneously.

Not to be continued

"Compiling" in the Nnet3 configuration

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.