|
Methods defined here:
- __init__(self)
- Create an empty network
- __str__(self)
- returns self.to_str()
- add(self, op, name=None, inputs=None, outputs=None, options=None)
- Add new operator to network, it is appended to the end.
Parameters:
op: string operator type, for example Activation
name: string a unique name of the operator, if not provided it is auto-generated
inputs: string or list of strings operator inputs, if not provided it takes outputs of the provious operator or network input
in no operator exits (must be single input)
outputs: string or list of strings, if not defined single output name is autogeneratord
options: dict - dictionart of options for operator op.
- add_input(self, name, shape, dtype='float')
- Define network input tensor
Parameters:
name: string name of input tensor
shape: list/tuple of integers shape of input tensor
dtype: type of input tensor: float, int32, etc.
- save(self, path)
- Save network definition to file named path
- set_outputs(self, outputs)
- Specify network outputs, outputs need to be list of strings that define output tensor names
for example ["prob","loss"]
Note: if no output is set the output of the last operator is considered network output
- to_json(self)
- Return json representaion of the network, note it is python dictionary that can be serialized to json
- to_str(self)
- Create json representation of the network as string
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|