def __init__(self, input_ch, e_ch, h_io_chs=[1,1,1,1,1,1,1], h_k_szs=[2,2,2,2,2,1,1], h_dils=[1,2,4,8,16,1,1], use_glu=False): super(SeqClassifier, self).__init__() h_io_chs[:] = [n * e_ch for n in h_io_chs] self.front_1x1 = nn.Conv1d(input_ch, e_ch,1) self.h_block = HighwayDCBlock(h_io_chs, h_k_szs, h_dils, causality=True, use_glu=use_glu) self.last_1x1 = nn.Sequential(nn.Conv1d(e_ch,e_ch,1), nn.ReLU(), nn.Conv1d(e_ch,e_ch,1), nn.ReLU()) self.classifier = nn.Sequential(nn.Conv1d(e_ch,e_ch,1), nn.ReLU(), nn.Conv1d(e_ch,e_ch,1))#nn.Conv1d(e_ch,1,1))
def __init__(self, input_dim, e_ch, #d_ch=256, #h_io_chs=[256, 256, 256, 256, 256, 256, 256], d_ch, h_io_chs=[1,1,1,1,1,1,1], h_k_szs=[2,2,2,2,2,1,1], h_dils=[1,2,4,8,16,1,1], # h_dils=[1,2,4,1,2,4,1,2,4,1,1,1,1], #이것도 Receptive Field가 20인데 왜 안되는걸까?????? use_glu=False): super(SeqFeatEnc, self).__init__() h_io_chs[:] = [n * d_ch for n in h_io_chs] # Layers: self.mlp = nn.Sequential(nn.Conv1d(input_dim,e_ch,1), nn.ReLU(), nn.Conv1d(e_ch,d_ch,1)) self.h_block = HighwayDCBlock(h_io_chs, h_k_szs, h_dils, causality=True, use_glu=use_glu) return None