keras-io
keras-io copied to clipboard
Questions on Depth Estimation Example keras: Activation Function, Loss Function
the issue is for this: https://keras.io/examples/vision/depth_estimation/
-
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).
-
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?