Provides a C++ interface to convert a KataGo model into a CoreML model using Apple’s native CoreML libraries.
This repository is a work in progress. Currently focused on:
- Building convolution operations
-
Configure and build the C++ interface
mkdir build cd build cmake .. make -
Run tests
ctest
Expected output:
100% tests passed, 0 tests failed out of 1
To install this library, run:
make install- CMake Configuration
Add the following lines to your CMakeLists.txt:
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
find_package(KataGoCoreML REQUIRED)
target_link_libraries(katago KataGoCoreML ${Python3_LIBRARIES})- Model Conversion Workflow
In your C++ code, perform the following steps:
- Convert KataGo’s
ModelDescobject into aKataGoCoreML::ModelDescobject. - Use this to construct a
KataGoCoreML::ModelBuilderobject. - Call the
createMLPackage(outputPath)member function to generate a CoreML model package.
See test/test_main.cpp for an example.
This project is licensed under the MIT License. See LICENSE for details.