neoml

neoml-libApache-2.0更新放缓

C++ 编写的机器学习框架,同时支持深度学习与传统算法,可加载 ONNX 模型,适合在 C++ 项目中集成训练与推理能力。

Machine learning framework for both deep learning and traditional algorithms

NeoML-master_2.0.5.0发布于 2021-06-22 05:25 UTC799star124fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
cmake -DCMAKE_BUILD_TYPE=Release ..
硬件要求按 README 说明

GPU 训练与推理为可选:Windows 需支持 CUDA 11.2 upd.1 的 NVIDIA 显卡,iOS 需 Apple A7+,Android 需支持 Vulkan 1.0;Linux 和 macOS 暂不支持 GPU。CPU 可运行,Windows、Linux、macOS 上建议用 Intel MKL 提升性能。README 未说明显存要求。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

ABBYY 开源的端到端机器学习框架,同时覆盖深度学习和传统算法,可跨平台训练与部署

C++ 编写的机器学习框架,同时支持深度学习与传统算法,可加载 ONNX 模型,适合在 C++ 项目中集成训练与推理能力。

核心能力

  • 支持 100 多种神经网络层类型
  • 内置 20 多个传统算法,涵盖分类、回归、聚类
  • 同一套代码跨 Windows、Linux、macOS、iOS、Android 运行
  • 可导入 ONNX 模型,复用其他框架训练的结果
  • 提供 Python、C++、Java、Objective-C 多语言接口

容易踩的坑

Linux 和 macOS 目前不支持 GPU 加速,只能跑 CPU;NeoML 训练出的模型无法导出为 ONNX,只能导入;神经网络实现非线程安全,一个网络只能在一个线程中运行;GPU 计算时整个网络必须统一使用同一个数学引擎,不能 CPU 与 GPU 混用。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本NeoML-master_2.0.5.0
  1. NeoML-master_2.0.5.0NeoML v2.0.5最新正式版2021-06-22 · 2021-06-22 05:25 UTC

    We are glad to present to you the second release of NeoML! NeoML is an end-to-end machine learning framework that allows you to build, train, and deploy ML models.

    Major Features

    Neural networks with support for over 100 layer types Traditional machine learning: 20+ algorithms (classification, regression, clustering, etc.) CPU and GPU support, fast inference ONNX support Languages: C++, Python, Java, Objective-C Cross-platform: the same code can be run on Windows, Linux, macOS, iOS, and Android

  2. NeoML-master_1.0.1.0NeoML v1.0.12020-06-14 · 2020-06-14 17:44 UTC
    查看更新说明

    We are glad to present to you the first release of NeoML! NeoML is an end-to-end machine learning framework that allows you to build, train, and deploy ML models.

    Major Features

    • Neural networks with support for over 100 layer types
    • Traditional machine learning: 20+ algorithms (classification, regression, clustering, etc.)
    • CPU and GPU support, fast inference
    • ONNX support
    • Languages: C++, Java, Objective-C
    • Cross-platform: the same code can be run on Windows, Linux, macOS, iOS, and Android

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    NeoML

    Desktop Build Status Python Build iOS Build Android Build Documentation Status

    NeoML is an end-to-end machine learning framework that allows you to build, train, and deploy ML models. This framework is used by ABBYY engineers for computer vision and natural language processing tasks, including image preprocessing, classification, document layout analysis, OCR, and data extraction from structured and unstructured documents.

    Key features:

    • Neural networks with support for over 100 layer types
    • Traditional machine learning: 20+ algorithms (classification, regression, clustering, etc.)
    • CPU and GPU support, fast inference
    • ONNX support
    • Languages: Python, C++, Java, Objective-C
    • Cross-platform: the same code can be run on Windows, Linux, macOS, iOS, and Android

    Contents

    Build and install

    Supported platforms

    The full С++ library version has been tested on the platforms:

    Target OSCompilerArchitecture
    Windows 7+ (CPU and GPU)MSVC 2019+x86, x86_64
    Ubuntu 14+ (CPU)gcc 5.4+x86_64
    MacOS 10.11+ (CPU)Apple clang 12+arm64, x86_64
    iOS 11+ (CPU, GPU)Apple clang 12+arm64-v8a, x86_64
    Android 5.0+ (CPU), Android 7.0+ (GPU)clang 7+armeabi-v7a, arm64-v8a, x86, x86_64

    The inference Java and Objective-C library versions have been tested on the platforms:

    Target OSCompilerArchitecture
    iOS 11+ (CPU, GPU)Apple clang 12+arm64-v8a, x86_64
    Android 5.0+ (CPU), Android 7.0+ (GPU)clang 7+armeabi-v7a, arm64-v8a, x86, x86_64

    Third party

    The library is built with CMake (recommended versions 3.18 and later).

    For best CPU performance on Windows, Linux and macOS we use Intel MKL.

    When processing on a GPU, you can optionally use CUDA (version 11.2 upd.1) on Windows or Linux and Vulkan (version 1.1.130 and later) on Windows, Linux or Android.

    We also use Google Test for testing and Google Protocol Buffers for working with ONNX model format.

    We use very convinous generator of JIT code xbyak for speeding up some convolutions on x86_64 processors.

    Build fully functional C++ version

    See here for instructions on building the C++ library version for different platforms.

    Build inference versions for Java and Objective-C

    See here for instructions on building the Java and Objective-C versions that would only run the trained neural networks.

    Getting started

    Several tutorials with sample code will help you start working with the library:

    API description

    Basic principles

    The library was developed with these principles in mind:

    Platform independence

    The user interface is completely separated from the low-level calculations implemented by a math engine.

    The only thing you have to do is to specify at the start the type of the math engine that will be used for calculations. You can also choose to select the math engine automatically, based on the device configuration detected.

    The rest of your machine learning code will be the same regardless of the math engine you choose.

    Math engines independence

    Each network works with one math engine instance, and all its layers should have been created with the same math engine. If you have chosen a GPU math engine, it will perform all calculations. This means you may not choose to use a CPU for "light" calculations like adding vectors and a GPU for "heavy" calculations like multiplying matrices. We have introduced this restriction to avoid unnecessary synchronizations and data exchange between devices.

    Multi-threading support

    The math engine interface is thread-safe; the same instance may be used in different networks and different threads.

    Note that this may entail some synchronization overhead.

    However, the neural network implementation is not thread-safe; the network may run only in one thread.

    ONNX support

    NeoML library also works with the models created by other frameworks, as long as they support the ONNX format. See the description of import API. However, you cannot export a NeoML-trained model into ONNX format.

    Serialization format

    The library uses its own binary format (implemented by CArchive, CArchiveFile) to save and load the trained models.

    GPU support

    Processing on GPU often helps significantly improve performance of mathematical operations. The NeoML library uses GPU both for training and running the models. This is an optional setting and depends on the hardware and software capabilities of your system.

    To work on GPU, the library requires:

    • Windows: NVIDIA® GPU card with CUDA® 11.2 upd. 1 support.
    • iOS: Apple GPU A7+.
    • Android: devices with Vulkan 1.0 support.
    • Linux/macOS: no support for GPU processing as yet.
    FineObj

    The NeoML library originates in ABBYY internal infrastructure. For various reasons ABBYY uses a cross-platform framework called FineObj. Because of this, the open library version uses some of this framework primitives. See the common classes description.

    C++ interface

    NeoML contains two C++ libraries:

    Algorithms library NeoML

    The library provides C++ objects that implement various high-level algorithms. It consists of several parts:

    NeoMathEngine

    The math engine used for calculations is a separate module that implements the low-level mathematical functions used in the algorithms library. The user can also call these functions but usually never needs to.

    This module has different implementations for different platforms. In particular, there is an implementation that uses a GPU for calculations.

    The math engine is also a set of C++ interfaces described here.

    Python module

    See the extensive documentation of the Python module on readthedocs.io.

    Java interface

    To work with the inference version of the library in Java and Kotlin we provide a Java interface.

    Objective-C interface

    To work with the inference version of the library in Swift and Objective-C we provide an Objective-C interface.

    License

    Copyright © 2016-2020 ABBYY Production LLC. Licensed under the Apache License, Version 2.0. See the license file.