Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why calculate 'MSE' or 'MAE' in axis=(0,1)? and what shape of output and every dimention means what? #9

Open
nana1223 opened this issue Jan 16, 2024 · 1 comment

Comments

@nana1223
Copy link

in utils.py:
def MAE(pred, true):
return np.mean(np.abs(pred - true), axis=(0, 1)).sum()

def MSE(pred, true):
return np.mean((pred - true) ** 2, axis=(0, 1)).sum()

thank you!!!!!!

@SongTang-x
Copy link
Owner

hi,
1.Calculating 'MSE' and 'MAE' over axis=(0,1) for tensors shaped (B, S, C, H, W) averages the errors across all batch samples (B) and sequence steps (S). This method provides an aggregated error metric for B*S images in the batch, encompassing both individual samples and temporal aspects.
2.The resulting shape (C, H, W) corresponds to the number of channels (C) and the spatial dimensions of the images (height H and width W). This means that the resulting array provides a separate average error (either MAE or MSE) for each channel of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants