keras-io icon indicating copy to clipboard operation
keras-io copied to clipboard

Questions on Depth Estimation Example keras: Activation Function, Loss Function

Open georgekasa opened this issue 1 year ago • 0 comments

the issue is for this: https://keras.io/examples/vision/depth_estimation/

  1. In the code, the final convolutional layer uses a tanh activation function: self.conv_layer = layers.Conv2D(1, (1, 1), padding="same", activation="tanh") However, I noticed that the loss function is defined as SparseCategoricalCrossentropy with from_logits=True: The from_logits=True argument suggests that the model's output is expected to be logits (i.e., without any activation function).

  2. Another question I have is about the choice of the tanh activation function for a depth estimation task. In my understanding, a linear activation function would seem more appropriate for this type of problem, as it allows for continuous output values. Could you please provide some insights into why the tanh activation function was chosen instead?

georgekasa avatar Apr 20 '23 18:04 georgekasa