def __init__(self, time_steps: int, spatial_encoder_planes: Tuple[int, ...], bottleneck_planes: int, spatial_decoder_planes: Tuple[int, ...], classifier_drop_rate: float, class_embed_planes: int, num_classes: int, vote_type: str): super(VAETimeAlignedResNet, self).__init__() self.spatial_encoder_planes = spatial_encoder_planes self.spatial_bottleneck_planes = bottleneck_planes self.spatial_decoder_planes = spatial_decoder_planes self.time_steps = time_steps self.drop_rate = classifier_drop_rate self.num_classes = num_classes self.class_embed_planes = class_embed_planes self.vote_type = vote_type self.class_in_planes = self.spatial_bottleneck_planes * self.time_steps self.spatial_encoder = se.VarSpatialResNetEncoder( self.spatial_encoder_planes, self.spatial_bottleneck_planes) self.temporal_encoder = te.VarTemporalResNetEncoder( self.time_steps, self.spatial_bottleneck_planes) self.decoder = sd.VarSpatialResNetDecoder( self.spatial_bottleneck_planes, self.spatial_decoder_planes) self.classifier = cls.VarTimeAlignedResNetClassifier( self.class_in_planes, self.class_embed_planes, self.drop_rate, self.num_classes) self.softmax = nn.Softmax(dim=-1) hp.he_init(self)
def __init__(self, time_steps: int, spatial_encoder_planes: Tuple[int, ...], bottleneck_planes: int, spatial_decoder_planes: Tuple[int, ...], classifier_drop_rate: float, class_embed_planes: int, num_classes: int, flow: bool): super(AETimeAlignedResNet, self).__init__() self.spatial_encoder_planes = spatial_encoder_planes self.spatial_bottleneck_planes = bottleneck_planes self.spatial_decoder_planes = spatial_decoder_planes self.time_steps = time_steps self.drop_rate = classifier_drop_rate self.class_embed_planes = class_embed_planes self.num_classes = num_classes self.flow = flow self.class_in_planes = self.spatial_bottleneck_planes * self.time_steps self.spatial_encoder = se.SpatialResNetEncoder( self.spatial_encoder_planes, self.spatial_bottleneck_planes) self.temporal_encoder = te.TemporalResNetEncoder( self.time_steps, self.spatial_bottleneck_planes) self.decoder = sd.SpatialResNetDecoder(self.spatial_bottleneck_planes, self.spatial_decoder_planes, self.flow) self.classifier = cls.TimeAlignedResNetClassifier( self.class_in_planes, self.class_embed_planes, self.drop_rate, self.num_classes) hp.he_init(self)
def __init__(self, time_steps: int, num_classes: int, dropout_prob: float = 0.0): super(I3D, self).__init__() self.time_steps = time_steps self.num_classes = num_classes self.dropout_prob = dropout_prob self.encoder = en.I3DEncoder(None) self.classifier = cls.I3DClassifier(1024, dropout_prob, num_classes) hp.he_init(self)
def __init__(self, time_steps: int, embed_planes: int, dropout_prob: float, num_classes: int, flow: bool): super(AEI3D, self).__init__() self.time_steps = time_steps self.num_classes = num_classes self.dropout_prob = dropout_prob self.embed_planes = embed_planes self.flow = flow self.encoder = en.I3DEncoder(self.embed_planes, flow=self.flow) self.decoder = de.I3DDecoder(self.embed_planes, self.time_steps, self.flow) self.classifier = cls.I3DClassifier(self.embed_planes, self.dropout_prob, self.num_classes) hp.he_init(self)