tf.contrib.receptive_field.get_compute_order

View source on GitHub

Computes order of computation for a given CNN graph.

Optionally, the function may also compute the input and output feature map resolutions at each node. In this case, input_node_name and input_node_size must be set. Note that if a node's op type is unknown, the input and output resolutions are ignored and set to None.

graph_def GraphDef object.
input_node_name Name of node with fixed input resolution (optional). This is usually the node name for the input image in a CNN.
input_node_size 2D list of integers, fixed input resolution to use (optional). This is usually the input resolution used for the input image in a CNN (common examples are: [224, 224], [299, 299], [321, 321]).

node_info Default dict keyed by node name, mapping to a named tuple with the following fields:

  • order: Integer denoting topological order;
  • node: NodeDef for the given node;
  • input_size: 2D list of integers, denoting the input spatial resolution to the node;
  • output_size: 2D list of integers, denoting the output spatial resolution of the node.
name_to_node Dict keyed by node name, each entry containing the node's NodeDef.