You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using UpSampling2D in mode "nearest", one index is skipped at exactly 8388608 (2^23). This results in a shift of all following data. See the image below:
At the end, the shape is fixed by just padding the last data:
Example Code:
import numpy as np
from keras import layers
a = np.zeros(2 ** 22 + 2)
a[1::2] = 1
up = layers.UpSampling2D(size=(2, 1))
b = up(a[None, :, None, None])
print(a[-6:].flatten())
# output: [0. 1. 0. 1. 0. 1.]
print(b[:, -6:, :, :].numpy().flatten())
# output: [1. 1. 0. 1. 1. 1.]
The text was updated successfully, but these errors were encountered:
When using UpSampling2D in mode "nearest", one index is skipped at exactly 8388608 (2^23). This results in a shift of all following data. See the image below:
![grafik](https://private-user-images.githubusercontent.com/71491044/343795997-53360260-77fb-4f7b-9420-83b05ac0b7f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMzc1NjAsIm5iZiI6MTcyMTIzNzI2MCwicGF0aCI6Ii83MTQ5MTA0NC8zNDM3OTU5OTctNTMzNjAyNjAtNzdmYi00ZjdiLTk0MjAtODNiMDVhYzBiN2YzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE3Mjc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiNWVjM2M1ZjAwNjBiNmQzODkxN2RhM2Q4NGY3ZjU4NzM4Mjg5NjlhMjNlYzAzNzlmNTc1YTY0NzI5ZTEzNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nYPB-8O9PBZVFho-tgEGJJfHqej6UxUfrFC_B85vE6U)
At the end, the shape is fixed by just padding the last data:
![grafik](https://private-user-images.githubusercontent.com/71491044/343796221-d43e8f07-fc1f-4b30-b025-cda56c24cd01.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMzc1NjAsIm5iZiI6MTcyMTIzNzI2MCwicGF0aCI6Ii83MTQ5MTA0NC8zNDM3OTYyMjEtZDQzZThmMDctZmMxZi00YjMwLWIwMjUtY2RhNTZjMjRjZDAxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE3Mjc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjZTVkZGUwZmM5MzZkYWIwODMwZGExNmRkYzRiZmI2YzFkYThhODgzYWI4NjI0YTQzZjFkMDkyYjJhOTFhOGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cmeDWu60hC6tlj3j6_i_42oZ2bm_Fy1Qsp2wqIXZBYs)
Example Code:
The text was updated successfully, but these errors were encountered: