GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Packages
  • Classes
  • Files
  • C++ API
  • GitHub
  • Class Index
  • Class Hierarchy
  • Class Members
  • SetupNets
  • task.py

This view

  • Original page
  • New address

GeezerVison is showing caffe2.ai — Caffe2 - Python API: caffe2.python.task.SetupNets Class Reference

Logo
Caffe2 - Python API
A deep learning, cross platform ML framework
  • Packages
  • Classes
  • Files
  • C++ API
  • Python API
  • GitHub
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • caffe2
  • python
  • task
  • SetupNets
Public Member Functions | Public Attributes | List of all members
caffe2.python.task.SetupNets Class Reference
Inheritance diagram for caffe2.python.task.SetupNets:

Public Member Functions

def __init__ (self, init_nets=None, exit_nets=None)
 
def setup (self, init_net)
 
def exit (self, exit_net)
 
def __repr__ (self)
 

Public Attributes

 init_nets
 
 exit_nets
 

Detailed Description

Allow to register a list of nets to be run at initialization
and finalization of Tasks or TaskGroups.
For example, let's say you have the following:

    init_net = core.Net('init')
    my_val = init_net.ConstantFill([], 'my_val', value=0)

    net = core.Net('counter')
    net.Add([my_val, net.Const(1),], [my_val])

    with TaskGroup() as task_group:
        with Node('trainer'):
            my_task = Task(step=[net])

In order to have `init_net` run once before `net` runs for the
first time, you can do one of the following:

    net.add_attribute(Task.TASK_SETUP, SetupNets([init_net]))

or

    net.add_attribute(TaskGroup.LOCAL_SETUP, SetupNets([init_net]))

- With Task.TASK_SETUP, init_net will run once at my_task startup.
- With TaskGroup.LOCAL_SETUP, init_net will run once on node 'trainer',
  before any task of the task group is run on that node.

The same SetupNets object can be added to multiple nets. It will only
run once per Task/TaskGroup run.

Definition at line 650 of file task.py.


The documentation for this class was generated from the following file:
  • caffe2/python/task.py

Generated on Thu Mar 21 2019 13:06:38 for Caffe2 - Python API by   doxygen 1.8.11

Facebook Open Source

Open Source Projects GitHub Twitter
Contribute to this project on GitHub
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.