-
Notifications
You must be signed in to change notification settings - Fork 133
Description
E.g. CumConcatLayer
from #589 allows (even enforces) you to specify dim_tag: DimensionTag
for the output axis.
I propose something similar for all other layers that introduce new dims. Basically for all layers introducing a new dynamic seq length here that could be useful.
This is already possible to do using an additional ReinterpretDataLayer
(or so, something that lets you specify new dim tags. I don't think this exists yet, but is easy to add). Then you would do:
'x_': {'class': 'split_dims', ...},
'x': {'class': 'reinterpret_data', 'from': 'x_', 'set_dim_tags': {
'stag:split_dims0': DimensionTag(...), 'stag:split_dims1': DimensionTag(...)}}
Here, split_dims0
and so on are the tag descriptions that SplitDimsLayer
internally sets.
Not only is this solution pretty verbose, it also relies on these internal tag descriptions. As a user, you would need to look them up frequently, and we would need to make sure that they don't change internally.
I would like to avoid this, proposing to add a dim_tags: List[DimensionTag]
option directly to SplitDimsLayer
.
With other layers, its the same idea.
This also promotes the best-practice that you should always name your axes properly.
Maybe, for some layers, we would even enforce the use of this. Especially for layers that really introduce an entirely new dim (like SplitDimsLayer
). But also for others. When enforced, this would need a new behavior version (#508).
(Related to that I would also allow to specify just a string with the description as dim_tag
to make this easier to use. Calling the DimensionTag
constructor is not that nice in Sisyphus configs.)
List of layers which need this
Also see: Operations on dimension tags
Layers (potentially) introducing a new dynamic seq length
ConvLayer
(done,out_spatial_dims
,out_dim
,in_spatial_dims
,in_dim
, ConvLayer and PoolLayer, in_dim, in_spatial_dims, out_dim, out_spatial_dims #789)PoolLayer
(done,out_spatial_dims
,out_dim
,in_spatial_dims
,in_dim
, ConvLayer and PoolLayer, in_dim, in_spatial_dims, out_dim, out_spatial_dims #789)TransposedConvLayer
(done,out_spatial_dims
,out_dim
,in_spatial_dims
,in_dim
, TransposedConvLayer in_dim, out_dim, in_spatial_dims, out_spatial_dims #791)WindowLayer
(done,out_spatial_dim
andwindow_dim
, WindowLayer, window_dim and out_spatial_dim #776)PadLayer
(done,out_dims
andaxes
, via PadLayer, out_spatial_dims option #778 and PadLayer, rename out_spatial_dims to out_dims #779)ResizeLayer
(done,out_dim
andaxis
, via ResizeLayer out_dim option #797)PrefixInTimeLayer
(done,out_dim
andaxis
, via PrefixInTimeLayer, PostfixInTimeLayer, axis and out_dim options #799)PostfixInTimeLayer
(done,out_dim
andaxis
, via PrefixInTimeLayer, PostfixInTimeLayer, axis and out_dim options #799)SliceLayer
(done,out_dim
, via SliceLayer, out_dim option #772)SliceNdLayer
(done,out_spatial_dim
orsize
, via SliceNdLayer, size can be DimensionTag #771, SliceNdLayer, out_spatial_dim option #838)MergeDimsLayer
(done,out_dim
andaxes
, via MergeDimsLayer, handle out_dim option #785)SplitDimsLayer
(done,dims
andaxis
, via SplitDimsLayer, dims can be list of DimensionTag #786)UnflattenNdLayer
(done,out_dims
,in_dim
, via UnflattenNdLayer, in_dim, out_dims options #802)RepeatLayer
(done,out_dim
andaxis
, via RepeatLayer, handle out_dim option #803)TimeChunkingLayer
(done,out_dim
andaxis
, via TimeChunkingLayer axis option, TimeUnChunkingLayer, dim tags #805)RemoveLayer
(done,out_dim
andaxis
, via RemoveLayer, out_dim and axis options #806)RecLayer
with search (done,axis
, via RecUnstackLayer, declare_rec_time option, axis optional #751)EditDistanceTableLayer
(done,out_dim
, via EditDistanceTableLayer, handle out_dim #807)MaskedComputationLayer
(done,out_spatial_dim
, via MaskedComputationLayer, out_spatial_dim option #811; further discussion:MaskedComputationLayer
is violating the principle that the user should not need to think about rec automatic optimization #769)CumConcatLayer
(done,out_spatial_dim
, via CumConcatLayer #589 and CumConcatLayer, out_spatial_dim instead of new_dim option #760)RangeFromLengthLayer
(done,out_spatial_dim
, via allow_broadcast_all_sources, changed default, new behavior version #759)RangeLayer
(done,out_spatial_dim
, via allow_broadcast_all_sources, changed default, new behavior version #759)ScatterNdLayer
(done,out_spatial_dim
, via ScatterNdLayer, out_spatial_dim option #770)
Layers involving some linear transformation on the features
LinearLayer
(done,out_dim
andin_dim
, via Generic LayerBase in_dim and out_dim options #765 and test_LinearLayer_in_dim_spatial, allow in_dim not feature dim #783)ConvLayer
(done,out_spatial_dims
,out_dim
,in_spatial_dims
,in_dim
, ConvLayer and PoolLayer, in_dim, in_spatial_dims, out_dim, out_spatial_dims #789)RecLayer
(done,axis
, via RecUnstackLayer, declare_rec_time option, axis optional #751)
Layers with fixed output shape
ConstantLayer
(done,shape
, via Explicit output dim tags for RandIntLayer, VariableLayer, ConstantLayer #762)VariableLayer
(done,shape
, via Explicit output dim tags for RandIntLayer, VariableLayer, ConstantLayer #762)RandIntLayer
(done,shape
, via Explicit output dim tags for RandIntLayer, VariableLayer, ConstantLayer #762)
Others
ReduceOutLayer
(done,out_dim
, via ReduceOutLayer, handle out_dim #808)StackLayer
(done,out_spatial_dim
, via StackLayer, out_spatial_dim option #809)SplitLayer
(done,out_dims
, via SplitLayer out_dims option #761)TileLayer
(done,out_dims
, via TileLayer, out_dims option #810)ConcatLayer
(done,out_dim
, via ConcatLayer, add out_dim #824)GatingLayer
(done,out_dim
, via GatingLayer, handle out_dim #839)