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

Remove unwanted loss function in depth_estimation.py #1506

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

SuryanarayanaY
Copy link
Contributor

@SuryanarayanaY SuryanarayanaY commented Aug 30, 2023

The depth_estimation.py example implements custom_loss function (i.e. calculate_loss) using 1. Structural similarity index(SSIM), 2. L1-loss, or Point-wise depth in our case and 3. Depth smoothness loss. The same loss function used in train_step also. But still model.compile() was given another loss function cross_entropy = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True, reduction="none") which has to be removed as it has no effect and also creates unwanted confusion.

Hence deleted the unwanted loss defined in model.compile()

Fixes #969

The depth_estimation.py example implements custom_loss function (i.e. calculate_loss) using 1. Structural similarity index(SSIM),  2. L1-loss, or Point-wise depth in our case and 3. Depth smoothness loss. The same loss function used in train_step also. But still model.compile() was given another loss function 
`cross_entropy = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True, reduction="none")` which has to be removed as it has no effect and also creates unwanted confusion.

Hence deleted the unwanted loss defined in model.compile()
The depth_estimation.py example implements custom_loss function (i.e. calculate_loss) using 1. Structural similarity index(SSIM), 2. L1-loss, or Point-wise depth in our case and 3. Depth smoothness loss. The same loss function used in train_step also. But still model.compile() was given another loss function cross_entropy = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True, reduction="none") which has to be removed as it has no effect and also creates unwanted confusion.

Hence deleted the unwanted loss defined in model.compile()
The depth_estimation.py example implements custom_loss function (i.e. calculate_loss) using 1. Structural similarity index(SSIM), 2. L1-loss, or Point-wise depth in our case and 3. Depth smoothness loss. The same loss function used in train_step also. But still model.compile() was given another loss function cross_entropy = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True, reduction="none") which has to be removed as it has no effect and also creates unwanted confusion.

Hence deleted the unwanted loss defined in model.compile()
@pcoet
Copy link
Collaborator

pcoet commented Sep 6, 2023

@SuryanarayanaY Do you know how to resolve the docker-image failure? Then we can merge this...

@pcoet
Copy link
Collaborator

pcoet commented Sep 7, 2023

@sachinprasadhs mentioned that this issue should be fixed, so I'll go ahead and merge the PR.

@pcoet pcoet merged commit 1279596 into keras-team:master Sep 7, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confused about loss in depth estimation example
3 participants