Skip to content

← deep_learning package

PartitionedStep

Apply a set of steps to different labeled subsets of the parameters, using a separately provided labeling dictionary, yielding a composite update step.

Using this node involves grouping your parameters into different groups, each identified by a specific group label. First, you list your group labels in the label0 to label9 entries. Then, you wire different steps (e.g., Adam, SGD, nothing, etc) into the corresponding step0 to step9 ports to configure which step shall run on which group of parameters. And finally you need to describe what parameters of your model, which are assumed to live in a parameters dictionary, belong to which group. This is done by specifying a labeling dictionary that has the same form as your model parameters dictionary, but instead of the actual tensors it contains the group labels (see help for that setting for more details). The update step will then run the specific labeled steps on parameters with the corresponding labels. Note that, if you want to run the same step on a heterogeneous data structure (e.g., nested dictionary) of parameters, you do not need this node since all step nodes already work on nested data structures. Version 0.2.0

Ports/Properties

gradients

Gradients to be transformed.

verbose name
Gradients
default value
None
port type
DataPort
value type
object (can be None)
data direction
INOUT

weights

Optional current weights.

verbose name
Weights
default value
None
port type
DataPort
value type
object (can be None)
data direction
IN

state

Explicit state of the node.

verbose name
State
default value
None
port type
DataPort
value type
object (can be None)
data direction
INOUT

labeling

A nested data structure (dictionary) of labels for individual parameters. This parameter can be used to assign different groups of parameters in your model different labels, by mirroring the data structure that holds your model parameter, but containing strings rather than the actual weight tensors. These labels are then used to select which of the wired-in steps to apply to which parameters. For example, if your model weights are stored in a dictionary with keys {'layer0', 'layer1', 'layer2', 'layer3'}, and you want to apply step0 to only the weights under 'layer1' and 'layer3', and step1 to the weights under 'layer0' and 'layer0', you might set the labeling port to {'layer0': 'a', 'layer1': 'b', 'layer2': 'a', 'layer3': 'b'}, and then set the label0 and label1 ports to 'b' and 'a' respectively. If your parameters dictionary contains a subtree and you want to assign the same label to all parameters in it, you can simply omit the subtree and instead of it include a string label in your labeling dict (i.e., the labeling can be a prefix tree, not necessarily a full tree). You can also wire the output of CreateDict into this port to generate the dictionary programmatically.

verbose name
Parameter Labeling Scheme
default value
{}
port type
DictPort
value type
dict (can be None)

label1

Apply step1 to parameters with this label.

verbose name
Apply Step1 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step1

Step 1.

verbose name
Step1
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label2

Apply step2 to parameters with this label.

verbose name
Apply Step2 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step2

Step 2.

verbose name
Step2
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label3

Apply step3 to parameters with this label.

verbose name
Apply Step3 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step3

Step 3.

verbose name
Step3
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label4

Apply step4 to parameters with this label.

verbose name
Apply Step4 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step4

Step 4.

verbose name
Step4
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label5

Apply step5 to parameters with this label.

verbose name
Apply Step5 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step5

Step 5.

verbose name
Step5
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label6

Apply step6 to parameters with this label.

verbose name
Apply Step6 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step6

Step 6.

verbose name
Step6
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label7

Apply step7 to parameters with this label.

verbose name
Apply Step7 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step7

Step 7.

verbose name
Step7
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label8

Apply step8 to parameters with this label.

verbose name
Apply Step8 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

step8

Step 8.

verbose name
Step8
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

label9

Apply step9 to parameters with this label.

verbose name
Apply Step9 To Parameters With This Label
default value
port type
StringPort
value type
str (can be None)

labelN

Additional labels corresponding to additional steps.

verbose name
Additional Steps
default value
[]
port type
ListPort
value type
list (can be None)

step9

Step 9.

verbose name
Step9
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

stepN

Additional Steps.

verbose name
Stepn
default value
None
port type
DataPort
value type
list (can be None)
data direction
IN

label0

Apply step0 to parameters with this label.

verbose name
Apply Step0 To Parameters With This Label
default value
first_label
port type
StringPort
value type
str (can be None)

step0

Step 0.

verbose name
Step0
default value
None
port type
DataPort
value type
BaseNode (can be None)
data direction
IN

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)