@@ -86,11 +86,6 @@ def get_projection_layer(
8686
8787 mlp_input_target = target_dim
8888
89- norm_layer = nn .RMSNorm (normalized_shape = input_dim )
90- act_layer = nn .GELU ()
91- projection_layers .append (norm_layer )
92- projection_layers .append (act_layer )
93-
9489 if projection_lcl_residual_blocks :
9590 cur_dim = input_dim
9691 while cur_dim // 4 > mlp_input_target :
@@ -101,6 +96,7 @@ def get_projection_layer(
10196 layer_type = "lcl_residual" ,
10297 diff_tolerance = cur_dim // 100 ,
10398 kernel_width_divisible_by = kernel_width_divisible_by ,
99+ dropout_p = 0.1 ,
104100 )
105101 if block is not None :
106102 projection_layers .append (block )
@@ -116,6 +112,8 @@ def get_projection_layer(
116112 projection_layers .append (fallback )
117113 cur_dim = halve_target
118114 else :
115+ projection_layers .append (nn .RMSNorm (normalized_shape = input_dim ))
116+
119117 try :
120118 lcl_projection_layer = get_1d_projection_layer (
121119 input_dimension = input_dim ,
@@ -125,9 +123,6 @@ def get_projection_layer(
125123 kernel_width_divisible_by = kernel_width_divisible_by ,
126124 )
127125 except ValueError :
128- # Sometimes we cannot create are reasonable LCL projection
129- # e.g. if target dim is much larger tha input dim so we have this
130- # fallback
131126 lcl_projection_layer = get_1d_projection_layer (
132127 input_dimension = input_dim ,
133128 target_dimension = mlp_input_target ,
@@ -137,16 +132,17 @@ def get_projection_layer(
137132 )
138133
139134 projection_layers .append (lcl_projection_layer )
135+ projection_layers .append (nn .RMSNorm (normalized_shape = mlp_input_target ))
140136 cur_dim = mlp_input_target
141137
142138 mlp_residual_block = MLPResidualBlock (
143139 in_features = cur_dim ,
144140 out_features = target_dim ,
145141 dropout_p = 0.0 ,
146- full_preactivation = True ,
147142 stochastic_depth_p = 0.0 ,
148143 )
149144 projection_layers .append (mlp_residual_block )
145+
150146 projected_shape = to_shape_no_batch
151147
152148 case "mlp_residual" :
@@ -155,13 +151,18 @@ def get_projection_layer(
155151
156152 projection_layer = MLPResidualBlock (
157153 in_features = input_dim ,
158- out_features = target_dim ,
154+ out_features = input_dim ,
159155 dropout_p = 0.0 ,
160- full_preactivation = True ,
161156 stochastic_depth_p = 0.0 ,
162157 reduce_at_fc_1 = False ,
163158 )
164159 projection_layers .append (projection_layer )
160+
161+ projection_layers .append (nn .RMSNorm (normalized_shape = input_dim ))
162+ projection_layers .append (
163+ nn .Linear (in_features = input_dim , out_features = target_dim )
164+ )
165+
165166 projected_shape = to_shape_no_batch
166167
167168 case "cnn" :
0 commit comments