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
2957a343
Commit
2957a343
authored
Feb 17, 2024
by
sbl1996@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fmt
parent
8ebcc022
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
261 deletions
+231
-261
Makefile
Makefile
+42
-0
assets/deck/Shiranui.ydk
assets/deck/Shiranui.ydk
+0
-63
assets/deck/Swordsoul.ydk
assets/deck/Swordsoul.ydk
+0
-1
xmake.lua
xmake.lua
+17
-19
ygoai/rl/agent.py
ygoai/rl/agent.py
+1
-1
ygoenv/ygoenv/ygopro/ygopro.h
ygoenv/ygoenv/ygopro/ygopro.h
+171
-177
No files found.
Makefile
0 → 100644
View file @
2957a343
SCRIPTS_REPO
:=
"https://github.com/Fluorohydride/ygopro-scripts.git"
SCRIPTS_DIR
:=
"../ygopro-scripts"
DATABASE_REPO
:=
"https://github.com/mycard/ygopro-database/raw/master/locales"
LOCALES
:=
en zh
.PHONY
:
all assets script py_install ygoenv_so
all
:
assets script py_install
py_install
:
ygoenv_so
pip
install
-e
ygoenv
pip
install
-e
.
ygoenv_so
:
ygoenv/ygoenv/ygopro/ygopro_ygoenv.so
ygoenv/ygoenv/ygopro/ygopro_ygoenv.so
:
xmake b ygopro_ygoenv
script
:
scripts/script
scripts/script
:
if
[
!
-d
$(SCRIPTS_DIR)
]
;
then
git clone
$(SCRIPTS_REPO)
$(SCRIPTS_DIR)
;
fi
ln
-sf
"../
$(SCRIPTS_DIR)
"
scripts/script
assets
:
$(LOCALES)
$(LOCALES)
:
% : assets/locale/%/cards.cdb assets/locale/%/strings.conf
assets/locale/en assets/locale/zh
:
mkdir
-p
$@
assets/locale/en/cards.cdb
:
assets/locale/en
wget
$(DATABASE_REPO)
/en-US/cards.cdb
-O
$@
assets/locale/en/strings.conf
:
assets/locale/en
wget
$(DATABASE_REPO)
/en-US/strings.conf
-O
$@
assets/locale/zh/cards.cdb
:
assets/locale/zh
wget
$(DATABASE_REPO)
/zh-CN/cards.cdb
-O
$@
assets/locale/zh/strings.conf
:
assets/locale/zh
wget
$(DATABASE_REPO)
/zh-CN/strings.conf
-O
$@
\ No newline at end of file
assets/deck/Shiranui.ydk
deleted
100755 → 0
View file @
8ebcc022
#created by ...
#main
55623480
52467217
52467217
52467217
92826944
92826944
92826944
41562624
41562624
99423156
99423156
94801854
94801854
94801854
49959355
49959355
49959355
79783880
14558127
14558127
14558127
36630403
36630403
23434538
23434538
23434538
97268402
12580477
18144507
75500286
81439173
13965201
13965201
24224830
24224830
40364916
40364916
4333086
4333086
10045474
10045474
40605147
40605147
41420027
#extra
59843383
27548199
50954680
83283063
74586817
52711246
57288064
26326541
98558751
86066372
72860663
86926989
37129797
91420202
41999284
!side
assets/deck/Swordsoul.ydk
View file @
2957a343
...
...
@@ -29,7 +29,6 @@
83308376
24224830
24224830
65681983
39730727
39730727
10045474
...
...
xmake.lua
View file @
2957a343
...
...
@@ -7,18 +7,17 @@ add_requires(
"concurrentqueue 1.0.4"
,
"sqlitecpp 3.2.1"
,
"unordered_dense 4.4.*"
)
target
(
"dummy_ygopro"
)
add_rules
(
"python.library"
)
add_files
(
"ygoenv/ygoenv/dummy/*.cpp"
)
add_packages
(
"pybind11"
,
"fmt"
,
"glog"
,
"concurrentqueue"
)
set_languages
(
"c++17"
)
set_policy
(
"build.optimization.lto"
,
true
)
add_includedirs
(
"ygoenv"
)
after_build
(
function
(
target
)
local
install_target
=
"$(projectdir)/ygoenv/ygoenv/dummy"
os
.
mv
(
target
:
targetfile
(),
install_target
)
print
(
"move target to "
..
install_target
)
end
)
-- target("dummy_ygopro")
-- add_rules("python.library")
-- add_files("ygoenv/ygoenv/dummy/*.cpp")
-- add_packages("pybind11", "fmt", "glog", "concurrentqueue")
-- set_languages("c++17")
-- add_includedirs("ygoenv")
-- after_build(function (target)
-- local install_target = "$(projectdir)/ygoenv/ygoenv/dummy"
-- os.cp(target:targetfile(), install_target)
-- print("Copy target to " .. install_target)
-- end)
target
(
"ygopro_ygoenv"
)
...
...
@@ -26,15 +25,14 @@ target("ygopro_ygoenv")
add_files
(
"ygoenv/ygoenv/ygopro/*.cpp"
)
add_packages
(
"pybind11"
,
"fmt"
,
"glog"
,
"concurrentqueue"
,
"sqlitecpp"
,
"unordered_dense"
,
"ygopro-core"
)
set_languages
(
"c++17"
)
add_cxxflags
(
"-flto=auto -fno-fat-lto-objects -fvisibility=hidden -march=native"
)
if
is_mode
(
"release"
)
then
set_policy
(
"build.optimization.lto"
,
true
)
add_cxxflags
(
"-march=native"
)
end
add_includedirs
(
"ygoenv"
)
-- for _, header in ipairs(os.files("ygoenv/ygoenv/core/*.h")) do
-- set_pcxxheader(header)
-- end
after_build
(
function
(
target
)
local
install_target
=
"$(projectdir)/ygoenv/ygoenv/ygopro"
os
.
mv
(
target
:
targetfile
(),
install_target
)
print
(
"
Move
target to "
..
install_target
)
os
.
cp
(
target
:
targetfile
(),
install_target
)
print
(
"
Copy
target to "
..
install_target
)
end
)
ygoai/rl/agent.py
View file @
2957a343
...
...
@@ -28,7 +28,7 @@ class Agent(nn.Module):
c
=
channels
self
.
loc_embed
=
nn
.
Embedding
(
9
,
c
)
self
.
loc_norm
=
nn
.
LayerNorm
(
c
,
elementwise_affine
=
affine
)
self
.
seq_embed
=
nn
.
Embedding
(
4
1
,
c
)
self
.
seq_embed
=
nn
.
Embedding
(
6
1
,
c
)
self
.
seq_norm
=
nn
.
LayerNorm
(
c
,
elementwise_affine
=
affine
)
linear
=
lambda
in_features
,
out_features
:
nn
.
Linear
(
in_features
,
out_features
,
bias
=
bias
)
...
...
ygoenv/ygoenv/ygopro/ygopro.h
View file @
2957a343
This diff is collapsed.
Click to expand it.
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