当前位置: 首页 > news >正文

Oracle 23ai Vector Search 系列之2 ONNX(Open Neural Network Exchange)

文章目录

  • Oracle 23ai Vector Search 系列之2 ONNX(Open Neural Network Exchange)
    • ONNX基本概念
      • ONNX(Open Neural Network Exchange)
      • ONNX Runtime
    • ONNX Runtime 在Oracle数据库中的集成
    • 参考

Windows 环境图形化安装 Oracle 23ai
Oracle 23ai Vector Search 系列之1 架构基础

Oracle 23ai Vector Search 系列之2 ONNX(Open Neural Network Exchange)

我们在看【Oracle AI Vector Search User’s Guide】文档时,会看到有很多地方都提到了“ONNX”,“ONNX”代表什么?

ONNX基本概念

ONNX(Open Neural Network Exchange)

  • ONNX是Open Neural Network Exchange的缩写,即开放神经网络交换。
  • ONNX是一种用于存储和交换机器学习模型的开放标准格式,旨在实现不同深度学习框架(如PyTorch、TensorFlow、MXNet等)之间的互操作性。
  • ONNX的主要功能和用途是使得AI模型可以在不同的框架和环境下交互使用,同时硬件和软件厂商可以基于ONNX标准优化模型性能,让所有兼容ONNX标准的框架受益。

参考:
https://github.com/onnx/onnx/tree/main

Open Neural Network Exchange (ONNX) is an open ecosystem that empowers AI developers to choose the right tools as their project evolves. ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types. Currently we focus on the capabilities needed for inferencing (scoring).

ONNX is widely supported and can be found in many frameworks, tools, and hardware. Enabling interoperability between different frameworks and streamlining the path from research to production helps increase the speed of innovation in the AI community. We invite the community to join us and further evolve ONNX.

ONNX就像是不同深度学习框架之间的”翻译官”,让模型可以在不同框架间自由转换。
例如用PyTorch训练了的模型(model.pt),可以转换成ONNX格式的模型(model.onnx),然后部署运行。

ONNX Runtime

ONNX格式的模型可通过ONNX Runtime运行。
ONNX Runtime是一个跨平台、能够更好地利用特定硬件的机器学习模型加速器。

参考:
https://onnxruntime.ai/docs/

ONNX Runtime is a cross-platform machine-learning model accelerator, with a flexible interface to integrate hardware-specific libraries. ONNX Runtime can be used with models from PyTorch, Tensorflow/Keras, TFLite, scikit-learn, and other frameworks.

ONNX Runtime 在Oracle数据库中的集成

我们知道Oracle Database 23ai集成了AI Vector Search等功能,支持VECTOR 数据类型,可以直接在 Oracle Database 23ai 中存储向量。
但要想使用AI Vector Search等功能,首先将文本等信息转换成vector,这就需要embedding模型。

作为最为强大的数据库,Oracle也提供了各种支持。

  • Oracle 23ai数据库对ONNX Runtime 进行了集成,允许导入包括embedding模型等ONNX格式的AI模型到数据库中使用。
  • Oracle提供了Python实用程序包帮助用户把其他预训练模型转换为ONNX格式的模型。

具体的ONNX格式模型转换方法可以参考如下文档:

Import Pretrained Models in ONNX Format

  • Oracle提供了ONNX格式的嵌入生成模型all-MiniLM-L12-v2。并可以通过DBMS_VECTOR.LOAD_ONNX_MODEL加载到数据库中。

参考:
Now Available! Pre-built Embedding Generation model for Oracle Database 23ai

参考

Oracle Machine Learning for SQL (OML4SQL) API Guide
>39.1 About ONNX

Oracle Machine Learning for Python (OML4Py) User’s Guide

Import Pretrained Models in ONNX Format

onnx
https://github.com/onnx/onnx

https://onnx.ai/index.html

https://oracle-base.com/articles/23/ai-vector-search-23

相关文章:

  • Webpack 配置详解:从入门到实战
  • 复习MySQL20250327
  • OmniPlan Pro for Mac 项目管理流程
  • 人工智能模型的自我学习能力
  • 相对位置2d矩阵和kron运算的思考
  • 各种响应的理解
  • Java学习打卡-Day22-多线程
  • Dify 服务器部署指南
  • SpringBean模块(二)bean初始化(2)和容器初始化顺序的比较--引入ApplicationContextInitializer
  • SQLark SQL编辑器秘籍,编写高效SQL查询
  • SpringBoot3解决跨域请求问题(同源策略、JSONP、CORS策略)(Access-Control-Allow-Origin)(2025详细教程)
  • 电销行业机器人外呼话术设计:关键注意事项与实践指南
  • C语言之数据结构:双向链表
  • 整理一些php7 新特性
  • Node.js 模块加载机制--详解
  • 【设计模式】策略模式+门面模式设计对接银行接口的API
  • # 线性代数:660习题总结660# 宋浩讲解视频
  • [Lc18_拓扑排序] string+queue+map | 火星字典
  • Stable Diffusion vue本地api接口对接,模型切换, ai功能集成开源项目 ollama-chat-ui-vue
  • 银行的压力测试如何进行?
  • 李强会见巴西总统卢拉
  • 哈佛新论文揭示 Transformer 模型与人脑“同步纠结”全过程!AI也会犹豫、反悔?
  • 区域国别学视域下的东亚文化交涉
  • 他站在当代思想的地平线上,眺望浪漫主义的余晖
  • 国内首例侵入式脑机接口系统前瞻性临床试验:受试者已能用意念玩游戏
  • 巴基斯坦称对印精准打击造成设施损坏和人员伤亡