Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygo-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Biluo Shen
ygo-agent
Commits
4ae87a70
Commit
4ae87a70
authored
May 28, 2024
by
sbl1996@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor seed
parent
cb324901
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
scripts/cleanba_l.py
scripts/cleanba_l.py
+8
-3
ygoenv/ygoenv/ygopro/ygopro.h
ygoenv/ygoenv/ygopro/ygopro.h
+1
-1
No files found.
scripts/cleanba_l.py
View file @
4ae87a70
...
...
@@ -620,11 +620,16 @@ def main():
args
.
ckpt_dir
,
save_fn
,
n_saved
=
2
)
# seeding
seed_offset
=
args
.
local_rank
args
.
seed
+=
seed_offset
random
.
seed
(
args
.
seed
)
seed
=
random
.
randint
(
0
,
1e8
)
seed_offset
=
args
.
local_rank
seed
+=
seed_offset
init_key
=
jax
.
random
.
PRNGKey
(
seed
-
seed_offset
)
random
.
seed
(
seed
)
args
.
real_seed
=
random
.
randint
(
0
,
1e8
)
init_key
=
jax
.
random
.
PRNGKey
(
args
.
seed
-
seed_offset
)
key
=
jax
.
random
.
PRNGKey
(
args
.
real_seed
)
key
,
*
learner_keys
=
jax
.
random
.
split
(
key
,
len
(
learner_devices
)
+
1
)
learner_keys
=
jax
.
device_put_sharded
(
learner_keys
,
devices
=
learner_devices
)
...
...
ygoenv/ygoenv/ygopro/ygopro.h
View file @
4ae87a70
...
...
@@ -1726,7 +1726,7 @@ public:
throw
std
::
runtime_error
(
"record mode must be used with verbose mode and num_envs=1"
);
}
}
fmt
::
println
(
"env_id: {}, seed: {}, x: {}"
,
env_id_
,
seed_
,
dist_int_
(
gen_
));
//
fmt::println("env_id: {}, seed: {}, x: {}", env_id_, seed_, dist_int_(gen_));
duel_gen_
=
std
::
mt19937
(
dist_int_
(
gen_
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment