Casting #1224
-
I am defining a vector that specifies the number of nodes for each layer of a feed-forward neural network. Are there any potential issues with using
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, but the proof is a little subtle: if Dex executes That said, why not just avoid this situation by computing |
Beta Was this translation helpful? Give feedback.
No, but the proof is a little subtle: if Dex executes
unsafe_i_to_n ((n_to_i depth) - 1)
, it must be the case thatdepth > 0
, because otherwise the enclosingfor
would never run. Ergo,(n_to_i depth) - 1
is non-negative, so we have discharged the proof obligation imposed byunsafe_i_to_n
.That said, why not just avoid this situation by computing
ordinal i + 1 == depth
instead?