torchsig.models.model_utils.model_utils_1d.conversions_to_1dΒΆ

Functions

avgpool2d_to_avgpool1d

returns a MaxPool1d layer corresponding to the input MaxPool2d layer no muation is performed

batchNorm2d_to_GBN1d

returns a GBN1d [Ghost Batch Norm] layer corresponding to the input BatchNorm2d layer no muation is performed

batchNorm2d_to_batchNorm1d

returns a BatchNorm1d layer corresponding to the input BatchNorm2d layer no muation is performed

conv2d_to_conv1d

returns a 1d conv layer corresponding to the input conv2d layer no muation is performed

convert_2d_model_to_1d

converts a 2d model to a corresponding 1d model by replacing convolutional layers and other 2d layers with their 1d equivalents experimental; may not fully convert models with unrecognized layer types mutates input model; returns the mutated model this function is still under development and may not correctly convert all 2d layer types, or may have unexpected behavior on models that perform reshaping internally

get_1d_kernel

adjusts kernel shapes from 2d to 1d; returns 1d shape (single int)

make_fast_avg_pooling_layer

returns a FastGlobalAvgPool1d layer

maxpool2d_to_maxpool1d

returns a MaxPool1d layer corresponding to the input MaxPool2d layer no muation is performed

squeezeExcite_to_squeezeExcite1d

returns a GBN1d [Ghost Batch Norm] layer corresponding to the input BatchNorm2d layer no muation is performed

try_default

tries to return the result of a function call; returns result_on_error on error