mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-14 20:41:13 +08:00
Add information for dropout probability (#304)
Co-authored-by: Chunyang Wen <chunyang_wen@apple.com>
This commit is contained in:
parent
a83d5d60bd
commit
05767b026f
@ -19,7 +19,7 @@ class Dropout(Module):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
if p < 0 or p >= 1:
|
if p < 0 or p >= 1:
|
||||||
raise ValueError("The dropout probability should be in [0, 1)")
|
raise ValueError("The dropout probability {p} is not in [0, 1)")
|
||||||
|
|
||||||
self._p_1 = 1 - p
|
self._p_1 = 1 - p
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ class Dropout2d(Module):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
if p < 0 or p >= 1:
|
if p < 0 or p >= 1:
|
||||||
raise ValueError("The dropout probability should be in [0, 1)")
|
raise ValueError(f"The dropout probability {p} is not in [0, 1)")
|
||||||
|
|
||||||
self._p_1 = 1 - p
|
self._p_1 = 1 - p
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user