mae vs mse for AE
- User
mae vs mse for AE
- Assistant
- User
if my dataset is all almost black pictures only with some space is colored?
- Assistant
When working with a dataset of images that are predominantly black with some areas containing color, the choice between Mean Absolute Error (MAE) and Mean Squared Error (MSE) for evaluating an Autoencoder can influence how the model handles such sparse information. Here are some considerations to keep in mind in this specific context:
- User
class ResidualAttentionFlatten(nn.Module): def init(self, dim): super(ResidualAttentionFlatten, self).init() self.linear1 = ResidualLinear(dim, dim) encoder_layer = nn.TransformerEncoderLayer(d_model=dim, nhead=4) self.transformer_encoder = nn.TransformerEncoder(encoder_layer, num_layers=3) #self.attenton = nn.MultiheadAttention(dim, 8, batch_first=True)
codedef forward(self, x): shape = x.shape x = x.flatten(2) x = self.linear1(x) #attn_output, attn_weights = self.attenton(x, x, x) attn_output = self.transformer_encoder(x) return (x + attn_output).view(shape)should i add attn_output or make it =
- Assistant