TransitionSpec
Describe an extra transition group to include during evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
Literal['pair', 'identity']
|
Either |
source |
str
|
Source class id. |
target |
str
|
Target class id. For |
symmetric |
bool
|
Whether to include both |
edges
Expand the spec into concrete directed transitions.
Returns:
| Type | Description |
|---|---|
FrozenSet[TransitionEdge]
|
A frozenset of |
Source code in gradiend/trainer/core/transition_selection.py
Helpers
pair
Create a contrastive transition spec.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Source class id. |
required |
target
|
str
|
Target class id. |
required |
symmetric
|
bool
|
If True (default), include both |
True
|
Returns:
| Type | Description |
|---|---|
TransitionSpec
|
TransitionSpec describing the pair. |
Source code in gradiend/trainer/core/transition_selection.py
identity
Create an identity-transition spec.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
class_id
|
str
|
Class id for the self/self transition. |
required |
Returns:
| Type | Description |
|---|---|
TransitionSpec
|
TransitionSpec describing |