projects
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d0e56b
)
Added --seed.
author
Francois Fleuret
<francois@fleuret.org>
Tue, 26 May 2020 14:14:26 +0000
(16:14 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Tue, 26 May 2020 14:14:26 +0000
(16:14 +0200)
attentiontoy1d.py
patch
|
blob
|
history
diff --git
a/attentiontoy1d.py
b/attentiontoy1d.py
index
d7f06fe
..
92d90cf
100755
(executable)
--- a/
attentiontoy1d.py
+++ b/
attentiontoy1d.py
@@
-31,8
+31,15
@@
parser.add_argument('--positional_encoding',
help = 'Provide a positional encoding',
action='store_true', default=False)
help = 'Provide a positional encoding',
action='store_true', default=False)
+parser.add_argument('--seed',
+ type = int, default = 0,
+ help = 'Random seed (default 0, < 0 is no seeding)')
+
args = parser.parse_args()
args = parser.parse_args()
+if args.seed >= 0:
+ torch.manual_seed(args.seed)
+
######################################################################
label=''
######################################################################
label=''
@@
-62,8
+69,6
@@
if torch.cuda.is_available():
else:
device = torch.device('cpu')
else:
device = torch.device('cpu')
-torch.manual_seed(1)
-
######################################################################
seq_height_min, seq_height_max = 1.0, 25.0
######################################################################
seq_height_min, seq_height_max = 1.0, 25.0