#ai #machine-learning #federated-learning #artificial-intelligence #fl

xaynet-mobile

Xayn 网络项目正在构建机器学习的隐私层,以便 AI 项目能够满足 GDPR 和 CCPA 等合规性要求。该方法依赖于联邦学习作为启用技术,允许生产 AI 应用完全符合隐私合规。

1 个不稳定版本

0.1.0 2021年1月18日

#7#federated-learning


用于 xaynet

自定义许可证

470KB
8K SLoC

Xaynet FFI

生成 C-头文件

ffi-support 提供了一些有助于减少样板代码的宏。然而,在生成 C-头文件期间展开这些宏的功能(--pretty=expanded)仍然不稳定。因此,我们需要使用 rust nightly。

要生成头文件,请安装 cbindgen 并运行

cargo build
RUSTUP_TOOLCHAIN=nightly cbindgen \
    --config cbindgen.toml \
    --crate xaynet-mobile \
    --output xaynet_ffi.h

运行测试

macOS

cc -o tests/ffi_test.o -Wl,-dead_strip -I. tests/ffi_test.c ../target/debug/libxaynet_mobile.a -framework Security -framework Foundation
./tests/ffi_test.o

Linux

gcc \
    tests/ffi_test.c
    -Wall \
    -I. \
    -lpthread -lm -ldl \
    ../target/debug/libxaynet_mobile.a \
    -o tests/ffi_test.o
./tests/ffi_test.o

要检查内存泄漏,可以使用 Valgrind

valgrind --tool=memcheck  --leak-check=full --show-leak-kinds=all -s ./tests/ffi_test.o

依赖

~31MB
~339K SLoC