为IvorySQL增添PACKAGE语法帮助

Hindsight 开源AI长记忆系统从零部署与MCP全链路实操指南 Hindsight是一款基于MCP协议的轻量级开源AI Agent长期记忆系统,通过Docker一键部署,实现跨会话持久记忆、语义检索与动态遗忘,无需依赖向量数据库。支持Cursor、LangChain等主流工具无缝集成,解决大模型“会话失忆”痛点。本文提供从环境配置、API实操到生产调优的全流程指南,涵盖记忆写入、召回、更新及常见问题排查,助力个人提效与企业Agent私有化落地。 阅读详情

认识语法帮助

当使用psql工具登录数据库时,\h command可以查看语法帮助。比如查看create database语法:

psql (17.6)
Type "help" for help.

ivorysql=# \h create database
Command:     CREATE DATABASE
Description: create a new database
Syntax:
CREATE DATABASE name
    [ WITH ] [ OWNER [=] user_name ]
           [ TEMPLATE [=] template ]
           [ ENCODING [=] encoding ]
           [ STRATEGY [=] strategy ]
           [ LOCALE [=] locale ]
           [ LC_COLLATE [=] lc_collate ]
           [ LC_CTYPE [=] lc_ctype ]
           [ BUILTIN_LOCALE [=] builtin_locale ]
           [ ICU_LOCALE [=] icu_locale ]
           [ ICU_RULES [=] icu_rules ]
           [ LOCALE_PROVIDER [=] locale_provider ]
           [ COLLATION_VERSION = collation_version ]
           [ TABLESPACE [=] tablespace_name ]
           [ ALLOW_CONNECTIONS [=] allowconn ]
           [ CONNECTION LIMIT [=] connlimit ]
           [ IS_TEMPLATE [=] istemplate ]
           [ OID [=] oid ]

URL: https://www.postgresql.org/docs/17/sql-createdatabase.html

ivorysql=#

这也算是个小技巧,不需要死记太多的sql语法,使用时直接查看就行。不仅打印出了对应sql的语法,还打印出了该语法对应的官方文档URL。

语法帮助原理分析

主要是@SOURCE_ROOT/src/bin/psql/help.c中helpSQL函数实现查看语法的功能。

从Makefile看还得依赖sql_help.c, sql_help.h一起编译完成。而从meson.build看是make的时候才生成这两个文件的,并且是使用create_help.pl读取文档目录@SOURCE_ROOT@/doc/src/sgml/ref中的所有语法文档生成的。

sql_help = custom_target('psql_help',
  output: ['sql_help.c', 'sql_help.h'],
  depfile: 'sql_help.dep',
  command: [
    perl, files('create_help.pl'),
    '--docdir', '@SOURCE_ROOT@/doc/src/sgml/ref',
    '--depfile', '@DEPFILE@',
    '--outdir', '@OUTDIR@',
    '--basename', 'sql_help',
  ],
)
generated_sources += sql_help.to_list()
psql_sources += sql_help

可以看到doc/src/sgml/ref目录下确实包含了其他所有对象的create的sgml文件,并没有create_package的文件。

ls doc/src/sgml/ref/create*
doc/src/sgml/ref/create_access_method.sgml  doc/src/sgml/ref/create_extension.sgml             doc/src/sgml/ref/create_operator.sgml     doc/src/sgml/ref/create_server.sgml        doc/src/sgml/ref/create_tsdictionary.sgml
doc/src/sgml/ref/create_aggregate.sgml      doc/src/sgml/ref/create_foreign_data_wrapper.sgml  doc/src/sgml/ref/create_opfamily.sgml     doc/src/sgml/ref/create_statistics.sgml    doc/src/sgml/ref/create_tsparser.sgml
doc/src/sgml/ref/create_cast.sgml           doc/src/sgml/ref/create_foreign_table.sgml         doc/src/sgml/ref/create_policy.sgml       doc/src/sgml/ref/create_subscription.sgml  doc/src/sgml/ref/create_tstemplate.sgml
doc/src/sgml/ref/create_collation.sgml      doc/src/sgml/ref/create_function.sgml              doc/src/sgml/ref/create_procedure.sgml    doc/src/sgml/ref/create_table_as.sgml      doc/src/sgml/ref/create_type.sgml
doc/src/sgml/ref/create_conversion.sgml     doc/src/sgml/ref/create_group.sgml                 doc/src/sgml/ref/create_publication.sgml  doc/src/sgml/ref/create_table.sgml         doc/src/sgml/ref/create_user_mapping.sgml
doc/src/sgml/ref/create_database.sgml       doc/src/sgml/ref/create_index.sgml                 doc/src/sgml/ref/create_role.sgml         doc/src/sgml/ref/create_tablespace.sgml    doc/src/sgml/ref/create_user.sgml
doc/src/sgml/ref/createdb.sgml              doc/src/sgml/ref/create_language.sgml              doc/src/sgml/ref/create_rule.sgml         doc/src/sgml/ref/create_transform.sgml     doc/src/sgml/ref/createuser.sgml
doc/src/sgml/ref/create_domain.sgml         doc/src/sgml/ref/create_materialized_view.sgml     doc/src/sgml/ref/create_schema.sgml       doc/src/sgml/ref/create_trigger.sgml       doc/src/sgml/ref/create_view.sgml
doc/src/sgml/ref/create_event_trigger.sgml  doc/src/sgml/ref/create_opclass.sgml               doc/src/sgml/ref/create_sequence.sgml     doc/src/sgml/ref/create_tsconfig.sgml

增添create package语法帮助

仿照create_table.sgml或其他文件,生成create_package.sgml和create_package_body.sgml文件。

从create_help.pl可知:
cmd取自sgml文件中refname标签,help取自synopsis标签,docbook_id取自refentry id标签。

因此create_package.sgml为:

<!--
doc/src/sgml/ref/create_package.sgml
PostgreSQL documentation
-->

<refentry id="sql-createpackage">
 <indexterm zone="sql-createpackage">
  <primary>CREATE PACKAGE</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>CREATE PACKAGE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE PACKAGE</refname>
  <refpurpose>define a new package</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
CREATE [ OR REPLACE ] PACKAGE [schema.] <replaceable class="parameter">package_name</replaceable>  [invoker_rights_clause] [IS | AS] 
   item_list[, item_list ...]  
END [<replaceable class="parameter">package_name</replaceable>]

invoker_rights_clause:
    AUTHID [CURRENT_USER | DEFINER]

item_list: 
[
   function_declaration    | 
   procedure_declaration   | 
   type_definition         | 
   cursor_declaration      | 
   item_declaration
]

function_declaration:
     FUNCTION <replaceable class="parameter">function_name</replaceable> [ (parameter_declaration[, ...]) ] RETURN datatype;

procedure_declaration:
     PROCEDURE <replaceable class="parameter">procedure_name</replaceable> [ (parameter_declaration[, ...]) ]

type_definition:
     record_type_definition      |
     ref_cursor_type_definition

cursor_declaration:
   CURSOR <replaceable class="parameter">name</replaceable>  [(cur_param_decl[, ...])] RETURN rowtype;

item_declaration:
     cursor_declaration             |
     cursor_variable_declaration    |
     record_variable_declaration    |
     variable_declaration           |

record_type_definition:
   TYPE record_type IS RECORD  ( variable_declaration [, variable_declaration]... ) ;

ref_cursor_type_definition:
   TYPE type IS REF CURSOR [ RETURN type%ROWTYPE ];

cursor_variable_declaration:
   curvar curtype;

record_variable_declaration:
   recvar { record_type | rowtype_attribute | record_type%TYPE };

variable_declaration:
   varname datatype [ [ NOT NULL ] := expr ]

parameter_declaration:
   parameter_name [IN] datatype [[:= | DEFAULT] expr]

</synopsis>
 </refsynopsisdiv>

create_package_body.sgml为:

<!--
doc/src/sgml/ref/create_package_body.sgml
PostgreSQL documentation
-->

<refentry id="sql-createpackagebody">
 <indexterm zone="sql-createpackagebody">
  <primary>CREATE PACKAGE BODY</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>CREATE PACKAGE BODY</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE PACKAGE BODY</refname>
  <refpurpose>define a new package body</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>

CREATE [ OR REPLACE ] PACKAGE BODY [schema.] <replaceable class="parameter">package_name</replaceable> [IS | AS]
   [item_list[, item_list ...]] | 
   item_list_2 [, item_list_2 ...]
   [initialize_section]
END [ <replaceable class="parameter">package_name</replaceable> ];


initialize_section:
   BEGIN statement[, ...]

item_list: 
[
   function_declaration    | 
   procedure_declaration   | 
   type_definition         | 
   cursor_declaration      | 
   item_declaration
]

item_list_2:
[
   function_declaration
   function_definition
   procedure_declaration
   procedure_definition
   cursor_definition
]

function_definition:
   FUNCTION <replaceable class="parameter">function_name</replaceable> [ (parameter_declaration[, ...]) ] RETURN datatype  [IS | AS]
   [declare_section] body;

procedure_definition:
   PROCEDURE <replaceable class="parameter">procedure_name</replaceable> [ (parameter_declaration[, ...]) ] [IS | AS] 
   [declare_section] body;

cursor_definition:
   CURSOR <replaceable class="parameter">name</replaceable> [ (cur_param_decl[, ...]) ] RETURN rowtype IS select_statement;

body:
   BEGIN statement[, ...] END [name];

statement:
   [<<LABEL>>] pl_statments[, ...];


</synopsis>
 </refsynopsisdiv>

当然还需对helpSQL函数做些修改,当查询的语法帮助为create package(body)时,展示IvorySQL对应的官方文档URL。

for (i = 0; QL_HELP[i].cmd; i++)
{
	if (pg_strncasecmp(topic, QL_HELP[i].cmd, len) == 0 ||
		strcmp(topic, "*") == 0)
	{
		PQExpBufferData buffer;
		char       *url;

		initPQExpBuffer(&buffer);
		QL_HELP[i].syntaxfunc(&buffer);
		if (pg_strncasecmp(QL_HELP[i].docbook_id, "sql-createpackage",17) == 0)
			url = "https://www.ivorysql.org/en/docs/compatibillity_features/package \n"
                "DETAIL: https://docs.ivorysql.org/en/ivorysql-doc/v4.6/v4.6/28";
		else
			url = psprintf("https://www.postgresql.org/docs/%s/%s.html",
					strstr(PG_VERSION, "devel") ? "devel" : PG_MAJORVERSION,
					QL_HELP[i].docbook_id);
		/* # of newlines in format must match constant above! */
		fprintf(output, _("Command:     %s\n"
				  "Description: %s\n"
				  "Syntax:\n%s\n\n"
				  "URL: %s\n\n"),
			QL_HELP[i].cmd,
			_(QL_HELP[i].help),
			buffer.data,
			url);
		if (pg_strncasecmp(QL_HELP[i].docbook_id, "sql-createpackage",17))
			free(url);
		termPQExpBuffer(&buffer);

		/* If we have an exact match, exit.  Fixes \h SELECT */
		if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0)
			break;
	}
}

重新编译安装psql工具后,已经可以查看create package的语法帮助了。

\h create package

psql (17.6)
Type "help" for help.

ivorysql=# \h create package
Command:     CREATE PACKAGE
Description: define a new package
Syntax:
CREATE [ OR REPLACE ] PACKAGE [schema.] package_name  [invoker_rights_clause] [IS | AS] 
   item_list[, item_list ...]  
END [package_name]

invoker_rights_clause:
    AUTHID [CURRENT_USER | DEFINER]

item_list: 
[
   function_declaration    | 
   procedure_declaration   | 
   type_definition         | 
   cursor_declaration      | 
   item_declaration
]

function_declaration:
     FUNCTION function_name [ (parameter_declaration[, ...]) ] RETURN datatype;

procedure_declaration:
     PROCEDURE procedure_name [ (parameter_declaration[, ...]) ]

type_definition:
     record_type_definition      |
     ref_cursor_type_definition

cursor_declaration:
   CURSOR name  [(cur_param_decl[, ...])] RETURN rowtype;

item_declaration:
     cursor_declaration             |
     cursor_variable_declaration    |
     record_variable_declaration    |
     variable_declaration           |

record_type_definition:
   TYPE record_type IS RECORD  ( variable_declaration [, variable_declaration]... ) ;

ref_cursor_type_definition:
   TYPE type IS REF CURSOR [ RETURN type%ROWTYPE ];

cursor_variable_declaration:
   curvar curtype;

record_variable_declaration:
   recvar { record_type | rowtype_attribute | record_type%TYPE };

variable_declaration:
   varname datatype [ [ NOT NULL ] := expr ]

parameter_declaration:
   parameter_name [IN] datatype [[:= | DEFAULT] expr]

URL: https://www.ivorysql.org/en/docs/compatibillity_features/package 
DETAIL: https://docs.ivorysql.org/en/ivorysql-doc/v4.6/v4.6/28

ivorysql=#

\h create package body

psql (17.6)
Type "help" for help.

ivorysql=# \h create package body
Command:     CREATE PACKAGE BODY
Description: define a new package body
Syntax:
CREATE [ OR REPLACE ] PACKAGE BODY [schema.] package_name [IS | AS]
   [item_list[, item_list ...]] | 
   item_list_2 [, item_list_2 ...]
   [initialize_section]
END [ package_name ];


initialize_section:
   BEGIN statement[, ...]

item_list: 
[
   function_declaration    | 
   procedure_declaration   | 
   type_definition         | 
   cursor_declaration      | 
   item_declaration
]

item_list_2:
[
   function_declaration
   function_definition
   procedure_declaration
   procedure_definition
   cursor_definition
]

function_definition:
   FUNCTION function_name [ (parameter_declaration[, ...]) ] RETURN datatype  [IS | AS]
   [declare_section] body;

procedure_definition:
   PROCEDURE procedure_name [ (parameter_declaration[, ...]) ] [IS | AS] 
   [declare_section] body;

cursor_definition:
   CURSOR name [ (cur_param_decl[, ...]) ] RETURN rowtype IS select_statement;

body:
   BEGIN statement[, ...] END [name];

statement:
   [<<LABEL>>] pl_statments[, ...];

URL: https://www.ivorysql.org/en/docs/compatibillity_features/package 
DETAIL: https://docs.ivorysql.org/en/ivorysql-doc/v4.6/v4.6/28

ivorysql=#

小结

psql的语法帮助文档挺好用的,本次给IvorySQL-4.6适配create package(body)语法帮助文档算是比较系统的了解了下语法帮助文档的原理。

引用:

[1]
helpSQL:
https://github.com/IvorySQL/IvorySQL/blob/IvorySQL_4.6/src/bin/psql/help.c#L575

[2]
URL: https://www.ivorysql.org/en/docs/Compatibillity_Features/package

tsfknn 预测R语言中的时间序列 rolling参数应该设置为FALSE,这使得最后的18个观测值成为测试集,其余的作为训练集;如果我们将rolling参数设置为默认值TRUE,那么测试集就不会是一个恒定的向量。lag 滞后参数表示时间序列数据的滞后值。在这个例子中,由于我们的时间序列数据是月度的,我们将参数设置为1:12。作为药品福利计划的一部分,澳大利亚健康保险委员会记录的属于ATC代码A10的产品的每月政府支出(百万美元)。我们将使用tsfknn包,它可以用来预测R语言中的时间序列。格式:ts类别的月度时间序列。 阅读详情

相关推荐

从ROS2到ROS1:Lightning-LM激光SLAM模块的移植实践与核心代码解析

本文详细解析了将高性能激光SLAM算法Lightning-LM从ROS2移植到ROS1的完整实践过程。针对ROS1与ROS2在节点初始化、话题通信、参数服务器及TF发布等核心API的差异,文章提供了loc_system和slam模块的核心代码改造示例,并给出了适配catkin的CMakeLists.txt与package.xml配置方案,帮助开发者在现有ROS1生态中高效集成先进的SLAM模块。

weixin_29224529的博客 172

fast-lio2复现跑avia数据集

本文详细介绍了在Windows WSL2中安装Ubuntu 22.04并配置ROS2 Humble环境的全过程,涵盖系统初始化、ROS2安装、Livox雷达驱动编译及FAST-LIO2 ROS2版本的构建与验证。通过完整数据集回放与建图测试,成功实现点云地图生成与轨迹记录,并利用evo工具完成轨迹分析与可视化。最终输出包括累积点云地图、位姿轨迹及实验配置文件,为后续精度评估与复现提供基准。

chase_my_dream的博客 369

RK3568开发板Debian系统屏幕旋转终极指南:从临时调整到永久设置

本文提供了RK3568开发板在Debian系统下实现屏幕旋转的完整解决方案。从使用xrandr命令进行临时调整,到修改X11配置文件实现永久设置,详细讲解了操作步骤与核心原理。指南还涵盖了多屏异显配置、触摸屏坐标校准等进阶技巧,帮助开发者彻底解决显示方向问题。

weixin_29181861的博客 390

linux学习

sudo make install:组装好的家具(编译好的库文件),原本放在你的临时工作区。坏处是,你的程序体积会变大。于是,他会根据你的计划书,结合你电脑的当前情况(比如装了什么编译器,库在哪),生成一本极度详细的《施工进度表》。很多大牌的第三方库(比如你刚装的 libevent)为了照顾不同的需求,会同时提供动态库(.so)和静态库(.a),但并不是所有库都这样。只有动态库:常见于系统的核心库(比如你系统的底层 C 库),或者一些商业闭源软件(厂商只给你一个黑盒子,不让你直接把代码打包进你的程序)。

d_mail的博客 194

Mask2former自定义数据集实现滑坡语义分割

先介绍一下这次用的数据集:Bijie Landslide Dataset,是武汉大学在Triplesat卫星上裁剪的数据集,包含770张滑坡(image、mask、dem、边界坐标txt)和2003张非滑坡数据(dem、image)。直接在ade20k修改,按照路径和设置将预处理数据放好,该步骤很快就能结束,打开的图片是全黑的,因为0和1在图片上肉眼较难区分。bijie的数据集可以直接使用,接下去的步骤是1、预处理数据。配置文件修改训练类别和训练类型,由于我们分割的是滑坡,所以进行语义分割。

weixin_57812838的博客 2217

手把手教你用键盘在Ubuntu上给Lerobot机械臂采集HIL-SERL训练数据(附完整配置文件)

本文详细介绍了在Ubuntu系统中使用键盘控制Lerobot机械臂进行HIL-SERL训练数据采集的完整流程。从环境准备、机械臂校准到键盘遥操系统配置和数据采集优化,提供了实战指南和常见问题解决方案,帮助读者高效获取高质量训练数据,推动具身智能和强化学习应用的发展。

weixin_30733003的博客 481

ubuntu 偶发启动失败问题分析

ubuntu 系统启动偶发异常问题分析

平面到立体 193

Unity之OpenXR+XR Interaction Toolkit实现 VR控制第一人称角色模型动画

我们在开发VR项目时,有时会有第一人称视角的需求,即我们自己带上VR头显,能够看到自己的身体,如果模拟一些人物触电死亡,使用工具动画之类的需求,那么VR控制第一人称视角就比较实用了。我们今天就来介绍一下如何实现VR设备控制第一人称:1.角色手部跟随手柄移动和旋转2.角色头部跟随VR头显转动和移动3.角色腿部跟随角色头显移动和下蹲。

TxNet 2845

python开源好项目

优先看 cszmzh/taobao-data-analyze:它的 SpringBoot + Vue 架构与你最契合,可以帮你快速理解如何将 Python 的分析结果嵌入到你熟悉的全栈体系中。值得一看的点:它的 advisor.py 模块实现了具体的调价规则,比如“竞品价 < 本店售价 × 0.90 时建议降价”,你可以直接参考或修改这些业务逻辑。分析内容:使用百万级的淘宝用户行为数据集,进行 AARRR 模型分析、RFM 分析以及各个环节转化流失分析,正好对应了你提到的“看看用户在哪个环节流失了”。

在技术领域里形成深刻,全面的认识,知道来龙去脉,深入浅出的讲到实用点。 330

【FISCO-BCOS】 八、ubuntu配置Java环境

ubuntu配置Java环境需根据自己的java版本号进行细节修改,本文以jdk11.0.18版本为例。ps:通过此法还可以查看java安装路径,但必须是环境配置成功的情况下才能使用。二、添加Java环境路径。四、检查java环境设置。

naihe_fish的博客 4315

YOLOv11 改进 - 下采样 | 轻量化突破:ADown 下采样让 YOLOv11 参量减、精度升

本文介绍了一种轻量级的特征下采样模块 ADown,它结合平均池化与最大池化策略,实现更有效的信息保留与压缩。在传统卷积网络中,特征下采样常造成信息损失,而 ADown 通过双通道并行结构优化了下采样效果,提升了模型的表达能力。在 YOLOv11 中引入 ADown 替换原有的下采样模块后,网络在保持高效性的同时,显著提升了目标检测的精度与稳定性。文章详细介绍了 ADown 的核心代码实现、模块注册流程以及 YOLOv11-ADown 模型的配置和训练方法,为轻量化目标检测模型的优化提供了实用参考。

魔改工程师的博客 1480

开源密码管理与双因素认证工具离线镜像合集

本集合汇总等开源密码管理与双因素认证相关离线包。侧重密码箱与 2FA,与「安全审计/渗透扫描」合集错开。

270

在 TASKPROCESSING 上为 ABAP OData 服务添加多个系统别名:从原理到落地的完整实践

本文面向SAP Gateway与ABAP开发者,详细讲解如何在TASKPROCESSING OData服务上添加系统别名。首先介绍了系统别名的概念与设计初衷,阐述了添加别名的业务场景需求,包括多系统接入、用户分流和灰度发布等。随后提供了标准配置步骤,从SPRO路径到具体操作说明,并分享了三个实际案例说明如何实现跨区域统一待办、按用户角色分流和灰度发布。最后给出了验证方法和常见问题解决方案,帮助开发者掌握这项基础但关键的配置技能,实现服务路由的可控管理。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 138

百度开源文心5.5 Flash Base:280B MoE 只激活 14B,4 步部署 + 3 个坑,微调还是等指令版

百度开源文心 5.5 Flash 基座权重:280B MoE 每 token 激活 14B,1M 上下文,同尺寸开源 Base 30 项基准多数领先。4 步部署(vLLM/SGLang completions 链路)+ 3 个高频坑 + 动手前 6 点核对清单,并给出微调 Base 还是等指令版的判断线。

weixin_50937681的博客 366

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

GitHub 开源趋势日报 | 2026-11-08

每日精选 GitHub Trending 热门项目,聚焦 AI 与大模型、Agent 智能体领域,带你用一篇文章看懂开源风向。

weixin_45631123的博客 408

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

云捷EMS开源能源管理系统JAVA实战,好用的能源管理系统

云捷EMS是一款开源能源管理系统,覆盖物联网网关、数据采集、分析与可视化全链路,支持50余种工业协议,适配水、电、汽、光伏等多类能耗设备。系统基于微服务架构,采用SpringBoot+Vue3技术栈,支持MQTT、WebSocket双通道采集,具备低代码大屏配置、实时数据与预计算分析能力,助力企业实现能耗监测、节能降耗与碳管理数字化,可直接部署或二次开发,适用于工厂、园区等高耗能场景。

weixin_42648890的博客 236

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

开源AI桌面助手哪个好?5类项目的能力、许可证与部署选型

从开源范围、产品定位、任务执行、模型接入、部署方式与许可证六个维度做一次横向梳理如果你正在寻找一款开源 AI 桌面助手,可能已经在 GitHub 上看到过不少项目。有些项目能够连接多个大模型,有些能够读取本地文件、执行命令,还有些可以调用浏览器、操作电脑,甚至让多个智能体协同完成工作。但这些项目并不完全属于同一类产品。例如,有的只是一个多模型聊天客户端,有的是能够直接执行任务的 AI Agent,还有的属于本地部署的 AI 管理平台。

sykdjs的博客 244

优雅草2026年10个开源鸿蒙工业软件项目五详解:鸿蒙星闪旋转设备振动监测节点

本项目聚焦旋转设备振动监测“最后一米”难题,基于开源鸿蒙与星闪技术,打造低功耗无线振动节点。采用ADXL355高精度传感器,5分钟周期采集3.2kHz原始波形,通过星闪上传至网关,由网关侧完成FFT分析、特征提取与基线对比,实现故障早期预警。打样目标包括16位采样、≥2周续航、丢包率可测,交付2个磁吸/螺栓节点及网关分析固件。未来将拓展至“振动+电流”双维监测,推动工业预测性维护在水运、排污等场景的低成本普及。

一颗优雅草科技-央千澈的优快云博客~只想无穷无尽的学习~作息早8-晚8 205

52万 Star 的“列表的目录”:sindresorhus/awesome 如何用一套治理规则,成为全球开源资源的信任锚点

awesome 是 Sindre Sorhus 维护的开源索引项目,无一行可运行代码,却以超 52 万 Star 长居 GitHub 第二。它作为“列表的目录”,通过严格治理(30 天考察期、awesome-lint 校验、CC0 许可、贡献者评审机制)筛选高质量资源清单,成为开发者寻找优质技术资源的可信入口。虽不保证内容实时性,但其“筛选即认证”的模式重塑了信息获取方式,推动形成整个 Awesome 生态规范。

下载资源或查看教程前,请务必阅读置顶的《免责声明》 456

让 Electron、Windows 桌面应用也能直接调用 uniCloud:unicloud-sdk 开源发布

摘要(148字): 为解决 Electron、Vue/React 项目及 Node.js 环境无法直接调用 uniCloud 的问题,开发者开源了 @yungot/unicloud-sdk。该 SDK 支持云对象、云函数、存储与登录态管理,兼容 Windows 桌面应用,通过设备身份签名与宿主桥机制保障安全,实现与 uni-app 一致的调用体验。已通过真实项目验证,支持 TypeScript、零依赖,适用于非 uni-app 场景的 uniCloud 接入。

IT开发 245

开源虚拟机与桌面虚拟化工具离线镜像合集

本集合汇总等开源虚拟机与桌面虚拟化相关离线包。不重分发 Oracle VirtualBox 专有二进制(PUEL),侧重 FOSS 生态与文档说明包。

234

【字节拥抱开源】Cola2:用连续隐变量重构语言模型,346B Token 跑出 60.10 八任务均分

Cola2 是一款基于连续隐变量的自适应语言模型,通过动态语义压缩与块因果扩散 Transformer(DiT)实现高效生成。它在346.03B token上训练,八项评测平均得分60.10,性能超越部分更大规模模型。其核心创新在于联合优化隐变量压缩与离散解码,支持受控扩展与稳定推理。项目提供完整权重、工具链及评测数据,适用于研究与应用。

weixin_41446370的博客 318

友好型开源模型SSM+Transformer 混合架构:Jamba 把 256K 长上下文塞进显存

**Jamba** 是 AI21 Labs 的 `Jamba` 混合 SSM-Transformer 开源大模型,原生 256K、Apache-2.0;本文讲清架构与部署,同档对标 Llama 5 / Qwen3.6。

雨1986的博客 349

qData 数据中台开源版 v1.6.6 发布:ETL 模块轻量化升级,优化定时任务磁盘占用问题

qData 数据中台开源版 v1.6.6 针对周期性数据集成任务的运维痛点,实现两项关键优化:一是拆分工具组件与 ETL 执行模块,减轻 JAR 包体积,提升部署与维护效率;二是修复定时任务中 ETL JAR 包持续累积问题,有效降低服务器磁盘占用。两项改进聚焦执行模块结构与运行过程管理,助力企业数据平台稳定、高效运行。

qiantongkeji的博客 272

Buoyant 开源 Kinference:面向 Kubernetes 与 vLLM 的推理控制平面

Buoyant 发布 Apache 2.0 许可的 Kinference v0.1.0-alpha.7,为 Kubernetes 上的 vLLM 提供路由策略、缓存感知负载均衡和按租户计量的推理控制平面。

老孙正经胡说 352

开源交易 Agent Vibe-Trading 本地部署+回测实战

一个 3.7 万 star 的开源交易 Agent,一条 pip 命令就能装好,号称能把问题直接变成回测报告。我在没有 Docker 的环境里把它跑起来后,第一件事就是怀疑它给出的回测结论——第一次跑出的策略收益好得离谱…

2301_80281820的博客 215
上一篇: 1024程序员节福利!参与互动,5分钟赢好礼!
下一篇: IvorySQL 社区摆摊啦,GOTC 2025 开源集市等你来玩!
IvorySQL
博客等级 码龄5年 745粉丝 565原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值