ClickHouse 25.3 版本发布说明

ClickHouse 25.3 json列类型使用示例 JSON已经成为现代数据系统中处理半结构化和非结构化数据的通用语言。无论是在日志记录和可观察性场景、实时数据流、移动应用存储还是机器学习管道中,JSON的灵活结构使其成为跨分布式系统捕获和传输数据的首选格式。 从clickhouse 25.3版本,在生产中已经可以使用JSON列类型 阅读详情

图片

本文字数:9393;估计阅读时间:24 分钟

作者: ClickHouse Team

本文在公众号【ClickHouseInc】首发

图片

又到了新版本发布的时间!

发布概要

ClickHouse 25.3 版本正式发布,本次更新带来了18项新功能🌱、13项性能优化🐣、48个bug修复🌦️

本次更新新增了对 AWS Glue 和 Unity 目录 的查询支持,引入了 查询条件缓存,优化了 S3 查询的自动并行化,并新增了一些 数组函数!

欢迎新贡献者

我们热烈欢迎所有在 25.3 版本中首次贡献代码的开发者!ClickHouse 社区的不断壮大令人振奋,我们由衷感谢每一位贡献者的支持和努力,正是你们的参与让 ClickHouse 变得越来越强大。

以下是本次版本的新增贡献者名单:

Andrey Nehaychik, Arnaud Briche, Cheryl Tuquib, Didier Franc, Filipp Abapolov, Ilya Kataev, Jason Wong, Jimmy Aguilar Mena, Mark Roberts, Onkar Deshpande, Shankar Iyer, Tariq Almawash, Vico.Wu, f.abapolov, flyaways, otlxm, pheepa, rienath, talmawash

AWS Glue 和 Unity 目录

贡献者:Alexander Sapin

本次版本新增了对 AWS Glue 和 Unity 数据目录的支持,使 ClickHouse 能够更好地与 Lakehouse 生态集成。

现在,你可以通过 AWS Glue 查询 Apache Iceberg 表。首先,需要创建一个数据库引擎:

CREATE DATABASE demo_catalog 
ENGINE = DataLakeCatalog
SETTINGS catalog_type = 'glue', region = 'us-west-2',
    aws_access_key_id = 'AKIA...', aws_secret_access_key = '...';

然后即可查询数据:

SHOW TABLES 
FROM demo_catalog;

SELECT * 
FROM "demo_catalog"."db.table";

Unity 目录 也支持 Apache Iceberg 和 Delta Lake 表。使用方式类似,先创建数据库引擎:

CREATE DATABASE unity_demo
ENGINE = DataLakeCatalog(
    'https://endpoint.cloud.databricks.com/api/2.1/unity-catalog')
SETTINGS catalog_type = 'unity',
    warehouse = 'workspace', catalog_credential = '...'

然后像查询普通表一样使用即可:

SHOW TABLES 
FROM unity_demo;

SELECT * 
FROM "unity_demo"."db.table";

JSON 数据类型现已正式可用于生产环境

贡献者:Pavel Kruglov

1.5 年前,我们发现 ClickHouse 的 JSON 存储 方案仍有很大优化空间,于是决定彻底重构。一年后,Pavel 开发出了一种全新的 列式 JSON 存储 方案,带来了更高效的数据存储与查询能力。详细过程请参考 [《我们如何为 ClickHouse 构建新的强大 JSON 数据类型》](How we built a new powerful JSON data type for ClickHouse)。

最终,我们实现了一种 性能、压缩率和易用性 远超现有 JSON 数据存储方案的技术,详见 [《十亿文档 JSON 挑战:ClickHouse vs. MongoDB、Elasticsearch 及更多》](The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more)。

TL;DR:据我们所知,这是列式存储首次被正确地应用于半结构化数据。ClickHouse 的新 JSON 存储具备以下优势:

  • 存储更紧凑,比磁盘上的压缩文件还小
  • 查询速度快数千倍,远超 MongoDB 等传统 JSON 存储,同时保持简洁易用
  • 支持完整的动态 JSON 路径,无需强制转换数据类型

现在,这一 JSON 存储方案已正式可用于生产环境,并深度集成 ClickHouse 查询加速功能! 你可以在 [《加速 ClickHouse 的 JSON 查询,助力 Bluesky 深入分析》](Accelerating ClickHouse queries on JSON data for faster Bluesky insights) 中了解更多。

此外,我们还开发了 JSONBench —— 业内首个 公正、中立的 JSON 文档分析基准测试。如果你尝试搜索类似的基准测试,会发现 目前没有其他可比的方案。

更重要的是,支撑该方案的核心技术 变体类型 (Variant type) 和 动态类型 (Dynamic type) 也已正式发布。它们不仅优化了 JSON 存储,还为未来 XML、YAML 等 半结构化数据格式 提供了支持。

我们迫不及待地想看看你会用它构建什么!快来试试吧! 如果你对 ClickHouse JSON 的未来发展感兴趣,欢迎查看我们的 [产品路线图](our roadmap)【https://github.com/ClickHouse/ClickHouse/issues/68428】。

查询条件缓存

贡献者:ZhongYuanKai

本次发布新增了 查询条件缓存 (Query Condition Cache),该功能可以 大幅加速重复查询,尤其适用于 仪表盘查询 和 可观测性分析 等场景。对于某些 无法利用主索引 的 高选择性 WHERE 条件,查询条件缓存能够有效优化查询性能。

例如,以下查询用于统计 Bluesky 上包含 椒盐卷饼表情符号 的所有帖子:

SELECT count()
FROM bluesky
WHERE (data.kind = 'commit')
  AND (data.commit.operation = 'create')
  AND (data.commit.collection = 'app.bsky.feed.post')
  AND (data.commit.record.text LIKE '%🥨%');

另一个查询用于分析 发布这些帖子时使用的主要语言:

SELECT
    arrayJoin(CAST(data.commit.record.langs, 'Array(String)')) AS language,
    count() AS count
FROM bluesky
WHERE (data.kind = 'commit')
  AND (data.commit.operation = 'create')
  AND (data.commit.collection = 'app.bsky.feed.post')
  AND (data.commit.record.text LIKE '%🥨%')
GROUP BY language
ORDER BY count DESC;

两个查询共享相同的 过滤条件 (predicate):

WHERE (data.kind = 'commit')
  AND (data.commit.operation = 'create')
  AND (data.commit.collection = 'app.bsky.feed.post')
  AND (data.commit.record.text LIKE '%🥨%')

查询条件缓存 机制会缓存 第一个查询 的扫描结果,并在 第二个查询 中直接复用,从而 大幅加速查询执行。如果你想深入了解 查询条件缓存 的具体实现、性能优化细节,以及上述查询的测试结果,可以参考我们的 [详细博客文章]【https://clickhouse.com/blog/introducing-the-clickhouse-query-condition-cache】。

自动并行化外部数据

贡献者:Konstantin Bogdanov

在上一节中,我们探讨了如何在 ClickHouse 的 MergeTree 表中查询 BlueSky 数据集,并统计其中的椒盐卷饼表情符号的出现次数。现在,让我们直接在 S3 上执行查询,看看所需时间:

SELECT count()
FROM s3('https://clickhouse-public-datasets.s3.amazonaws.com/bluesky/file_{0001..0100}.json.gz', 'JSONAsObject')
WHERE (json.kind = 'commit') 
AND (json.commit.operation = 'create') 
AND (json.commit.collection = 'app.bsky.feed.post') 
AND (json.commit.record.text LIKE '%🥨%')
SETTINGS 
  input_format_allow_errors_num = 100, 
  input_format_allow_errors_ratio = 1;
┌─count()─┐
│      69 │
└─────────┘

1 row in set. Elapsed: 64.902 sec. Processed 100.00 million rows, 13.35 GB (1.54 million rows/s., 205.75 MB/s.)
Peak memory usage: 2.68 GiB.

查询耗时刚刚超过 1 分钟!我的 ClickHouse Cloud 集群包含 10 个节点,借助 s3Cluster 表函数,我可以将文件的读取任务分配到所有节点:

SELECT count()
FROM s3Cluster(default, 'https://clickhouse-public-datasets.s3.amazonaws.com/bluesky/file_{0001..0100}.json.gz', 'JSONAsObject')
WHERE (json.kind = 'commit') 
AND (json.commit.operation = 'create') 
AND (json.commit.collection = 'app.bsky.feed.post') 
AND (json.commit.record.text LIKE '%🥨%')
SETTINGS 
  input_format_allow_errors_num = 100, 
  input_format_allow_errors_ratio = 1;

让我们测试一下查询所需的时间!

┌─count()─┐
│      69 │
└─────────┘

1 row in set. Elapsed: 16.689 sec. Processed 100.00 million rows, 13.38 GB (5.99 million rows/s., 801.86 MB/s.)
Peak memory usage: 2.06 GiB.

查询时间减少了 4 倍,虽然未能实现完全线性的加速,但优化效果仍然显著。

ClickHouse 提供了一系列 ...Cluster 函数(如 s3Cluster、azureBlobStorageCluster、deltaLakeCluster、icebergCluster 等),它们在任务分配方面类似于并行副本(parallel replicas),但有一个关键区别:并行副本按数据粒度范围(granule ranges)划分任务,而 ...Cluster 函数则按文件级别进行分配。我们用下图来展示上述查询的执行流程:

图片

首先,查询发起服务器(即接收查询的服务器)解析通配符模式(glob pattern),连接到其他服务器,并动态分发文件。其他服务器在完成当前任务后,会向发起服务器请求新文件,直到所有文件处理完毕。每台服务器会利用自身 CPU 核心数,采用 N 个并行流处理文件的不同部分。所有的部分查询结果最终被合并,并返回给发起服务器,以组装完整的查询结果。由于需要协调任务和合并数据,整体加速比并非严格线性。

从 ClickHouse 版本 25.3 开始,无需调用 ...Cluster 版本的远程数据访问函数即可实现分布式处理。只要启用了并行副本(parallel replicas),ClickHouse 就会在集群环境下自动进行任务分发。

如果不希望使用分布式处理,可以通过以下参数禁用:

SET parallel_replicas_for_cluster_engines = 0;

rraySymmetricDifferenc

贡献者:Filipp Abapolov

ClickHouse 提供了丰富的数组函数,能够解决多种数据处理问题。其中一个常见需求是:找出两个数组中只存在于其中一个,而不属于另一个的元素。

一种实现方式是先计算两个数组的并集,然后去除所有出现在交集中的元素:

WITH
    [1, 2, 3] AS a,
    [2, 3, 4] AS b
SELECT
    arrayUnion(a, b) AS union,
    arrayIntersect(a, b) AS intersect,
    arrayFilter(x -> (NOT has(intersect, x)), union) AS unionButNotIntersect;

这种方法可行,但如果有一个函数能直接完成这个操作,显然更为便捷。因此,我们引入了 arraySymmetricDifference:

WITH
    [1, 2, 3] AS a,
    [2, 3, 4] AS b
SELECT
    arrayUnion(a, b) AS union,
    arrayIntersect(a, b) AS intersect,
    arrayFilter(x -> (NOT has(intersect, x)), union) AS unionNotIntersect,
    arraySymmetricDifference(a, b) AS symmetricDifference;
┌─union─────┬─intersect─┬─unionNotIntersect─┬─symmetricDifference─┐
│ [3,2,1,4] │ [2,3]     │ [1,4]             │ [1,4]               │
└───────────┴───────────┴───────────────────┴─────────────────────┘

estimateCompressionRatio

贡献者:Tariq Almawash

本次发布新增的另一个函数是 estimateCompressionRatio,它可以评估对某列应用不同压缩算法可能产生的影响。

还记得 为何ClickHouse 如此快文章中数据压缩的部分吗?ClickHouse 在列级别进行数据压缩。

我们可以通过在 play.clickhouse.com 上的 hits 表中对 CounterID 列应用压缩算法,来观察其工作方式:

SELECT round(estimateCompressionRatio('NONE')(CounterID)) AS none,
       round(estimateCompressionRatio('LZ4')(CounterID)) AS lz4,
       round(estimateCompressionRatio('ZSTD')(CounterID)) AS zstd,
       round(estimateCompressionRatio('ZSTD(3)')(CounterID)) AS zstd3,
       round(estimateCompressionRatio('GCD')(CounterID)) AS gcd,
       round(estimateCompressionRatio('Gorilla')(CounterID)) AS gorilla,
       round(estimateCompressionRatio('Gorilla, ZSTD')(CounterID)) AS mix
FROM hits
FORMAT PrettyMonoBlock;

以下是查询的输出结果:

┏━━━━━━┳━━━━━┳━━━━━━┳━━━━━━━┳━━━━━┳━━━━━━━━━┳━━━━━━┓
┃ none ┃ lz4 ┃ zstd ┃ zstd3 ┃ gcd ┃ gorilla ┃  mix ┃
┡━━━━━━╇━━━━━╇━━━━━━╇━━━━━━━╇━━━━━╇━━━━━━━━━╇━━━━━━┩
│    1 │ 248 │ 4974 │  5110 │   1 │      32 │ 6682 │
└──────┴─────┴──────┴───────┴─────┴─────────┴──────┘

专用编解码器(GCD 和 Gorilla)对数据压缩影响较小。而更通用的编解码器,如 LZ4,尤其是 ZSTD,可以显著减少存储空间。此外,我们还可以调整 ZSTD 的压缩级别,数值越高,压缩比越大,但同时压缩过程也会更耗时,从而增加写入操作的时间。

该函数同样适用于尚未导入 ClickHouse 的数据。例如,以下查询返回存储在 S3 里的 Amazon Reviews Parquet 文件的模式信息:

DESCRIBE  s3(
  'https://datasets-documentation.s3.eu-west-3.amazonaws.com' ||
  '/amazon_reviews/amazon_reviews_2015.snappy.parquet'
)
SETTINGS describe_compact_output=1;
┌─name──────────────┬─type─────────────┐
│ review_date       │ Nullable(UInt16) │
│ marketplace       │ Nullable(String) │
│ customer_id       │ Nullable(UInt64) │
│ review_id         │ Nullable(String) │
│ product_id        │ Nullable(String) │
│ product_parent    │ Nullable(UInt64) │
│ product_title     │ Nullable(String) │
│ product_category  │ Nullable(String) │
│ star_rating       │ Nullable(UInt8)  │
│ helpful_votes     │ Nullable(UInt32) │
│ total_votes       │ Nullable(UInt32) │
│ vine              │ Nullable(Bool)   │
│ verified_purchase │ Nullable(Bool)   │
│ review_headline   │ Nullable(String) │
│ review_body       │ Nullable(String) │
└───────────────────┴──────────────────┘

接下来的查询计算了 product_category 列的压缩比:

SELECT round(estimateCompressionRatio(‘NONE’)(product_category)) AS none,
          round(estimateCompressionRatio(‘LZ4’)(product_category)) AS lz4,
          round(estimateCompressionRatio(‘ZSTD’)(product_category)) AS zstd
FROM
 s3(
  'https://datasets-documentation.s3.eu-west-3.amazonaws.com' ||
  '/amazon_reviews/amazon_reviews_2015.snappy.parquet'
);
┌─none─┬─lz4─┬─zstd─┐
│    1 │ 227 │ 1750 │
└──────┴─────┴──────┘

我们还可以评估,如果将数据导入到不同的列类型中,压缩效果会如何:

SELECT round(estimateCompressionRatio(‘NONE’)(product_category)) AS none,
          round(estimateCompressionRatio(‘LZ4’)(product_category)) AS lz4,
          round(estimateCompressionRatio(‘ZSTD’)(product_category)) AS zstd
FROM
 s3(
  'https://datasets-documentation.s3.eu-west-3.amazonaws.com' ||
  '/amazon_reviews/amazon_reviews_2015.snappy.parquet',
  ‘Parquet’,
  ‘product_category LowCardinality(String)’
);
┌─none─┬─lz4─┬─zstd─┐
│    1 │ 226 │ 1691 │
└──────┴─────┴──────┘

或者,在更改数据排序方式后,压缩比是否有所不同:

SELECT round(estimateCompressionRatio(‘NONE’)(product_category)) AS none,
          round(estimateCompressionRatio(‘LZ4’)(product_category)) AS lz4,
          round(estimateCompressionRatio(‘ZSTD’)(product_category)) AS zstd
FROM (
  SELECT * 
  FROM
   s3(
    'https://datasets-documentation.s3.eu-west-3.amazonaws.com' ||
    '/amazon_reviews/amazon_reviews_2015.snappy.parquet',
    ‘Parquet’,
    ‘product_category LowCardinality(String)’
  )
  ORDER BY product_category
);
┌─none─┬─lz4─┬─zstd─┐
│    1 │ 252 │ 7097 │
└──────┴─────┴──────┘

征稿启示

面向社区长期正文,文章内容包括但不限于关于 ClickHouse 的技术研究、项目实践和创新做法等。建议行文风格干货输出&图文并茂。质量合格的文章将会发布在本公众号,优秀者也有机会推荐到 ClickHouse 官网。请将文章稿件的 WORD 版本发邮件至:Tracy.Wang@clickhouse.com

【Clickhouse从入门到精通】第60篇:ClickHouse生态总结与未来展望 ClickHouse系列收官总结 本文作为《ClickHouse从入门到精通》系列的第60篇收官之作,系统回顾了整个系列的知识体系。文章从基础概念到高级应用,全面梳理了ClickHouse的核心技术: 知识体系:完整回顾了60篇文章的知识图谱,包括列式存储原理、MergeTree引擎家族、分布式架构等核心内容 生态工具:详细盘点了ClickHouse的企业版工具、运维监控、数据集成和可视化方案 版本演进:分析了从21.x到24.x的主要版本特性升级 未来趋势:展望了向量化引擎、湖仓一体、AI集成等发展方向 阅读详情

相关推荐

Lakes.AERMOD.View.v8.9.0 1CD大气扩散模型软件包

Lakes.AERMOD.View.v8.9.0 1CD大气扩散模型软件包 Lakes Environmental ARTM View v1.4.2 1CD放射物扩散模拟模型 Aermod View是一套完整的、功能强大的大气扩散模型软件包,并将美国EPA指定的大气扩散模型(如下)完美的集成成为一个综合的操作平 台: - AERMOD 电话TEL:18980583122  客服 QQ:11

yyii0000的博客 4001

ClickHouse 版本升级

ClickHouse 版本升级

style_boy的博客 3449

从摄像头选型到PCB布线:搞懂MIPI CSI带宽计算,避免你的嵌入式项目翻车

本文详细解析了MIPI CSI带宽计算在嵌入式项目中的关键作用,从摄像头选型到PCB布线提供全流程指导。通过实际案例和计算公式,帮助工程师准确计算带宽需求,避免图像丢帧和系统崩溃问题,同时优化PCB设计确保信号完整性。

weixin_30533109的博客 375

ClickHouse 24.1 版本发布说明

ClickHouse 在 2024 年的首个新版本发布来了!

ClickHouseDB的博客 2659

STM32使用 jansson 处理 Json格式字符

STM32 Json 字符的创建和解析1、Json简介2、jansson库的下载安装和报错解决2.1、下载安装2.2、STM32工程文件中导入jansson库2.3、报错解决2.4、修改堆栈空间3、Json 字符的创建4、Json 字符的解析4.1 纯键值对4.2、键的值是一个对象4.3、键的值是一个数组   STM32处理json字符串一般不常见,大部分都是不需要处理的数据,但是在一些通信中需要处理上传或者下传的数据,就别比如在物联网中,有一部分数据就是以json格式传输的,那么就需要对数据经行解析。我简

青烨慕容 7417

瑞芯微rv1126 rtsp+mpp+rga取流

瑞芯微rv1109 rtsp+mpp+rga取流

ZuoSeDiao的博客 6338

ClickHouse 23.12 版本发布说明

迎接2024年圣诞节后的第一个新版本。

ClickHouseDB的博客 2130

基于STM32的录音机设计(STM32F103+VS1053B)

本项目设计并实现了一款基于STM32微控制器的便携式录音机。该录音机采用STM32F103C8T6作为主控芯片,结合VS1053B音频编解码模块、SD卡存储、OLED显示屏以及按键模块,提供了手动录音、自动录音和录音回放等多种功能。

1万+

clickhose版本

ClickHouse的第22个主要版本中的第7个次要版本,经过1次修订或错误修复,并具有内部构建号或修订号2484。这个版本号用于标识和跟踪ClickHouse的特定发布和构建。版本号"22.7.1.2484"表示。

qq_41081716的博客 1951

MFC Tab Control控件完全指南:从基础使用到高级定制

本文详细介绍了MFC中TabControl控件的使用方法和高级技巧。主要内容包括:1) TabControl基础属性设置与绑定;2) 样式定制和外观自定义;3) 创建派生类实现扩展功能;4) 动态页面管理和子对话框控制;5) 高级功能如标签拖拽排序和右键菜单。通过完整代码示例,展示了从基本应用到复杂场景的实现方案,包括多标签页管理、自定义绘制、动态添加/删除标签等核心功能,为MFC开发者提供了全面的TabControl开发指南。

专注现代C++实战,从核心语法到高性能编程,助力开发者深入掌握系统级编程精髓。 257

小梅哥Xilinx FPGA学习笔记15——基于SPI接口的ADC芯片驱动

ADC(Analog to Digital Conver),通常是指一个将转变为数字信号(二进制表示的离散信号)的转换器。先将输入模拟电压转换成时间或频率,再把中间量转换成数字量双积分型 ADC,先对输入采样电压和基准电压进行两次积分,获得与采样电压平均值成正比的时间间隔,同时用计数器对标准时钟脉冲计数。抗干扰能力强,稳定性好,但转换速度低。①并联比较型 ADC,采用各量级同时并行比较,各位输出码也是同时并行产生,转换速度快。缺点是成本高、功耗大。

m0_51430584的博客 5502

ClickHouse 25.9 版本发布说明

ClickHouse 25.9 版本共带来了 25 项新功能 🍎、 22 项性能优化 🍁、 以及 83 个bug修复 🌿。

ClickHouseDB的博客 1928

Python爬虫实战:手把手教你如何抓取农作物品种名录,构建标准化种业索引数据库!

我长期专注 Python 爬虫工程化实战,主理专栏 《Python爬虫实战》:从采集策略到反爬对抗,从数据清洗到分布式调度,持续输出可复用的方法论与可落地案例。内容主打一个“能跑、能用、能扩展”,让数据价值真正做到——抓得到、洗得净、用得上。

喵手的博客 290

ClickHouse 25.5 版本发布说明

ClickHouse 25.5 版本带来了 15 项新特性、23 项性能优化和 64 项缺陷修复。

ClickHouseDB的博客 1703

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ClickHouse 25.7 版本发布说明

本次ClickHouse 25.6 发布包含 27 项新功能 🌸 26 项性能优化 🍦 以及 98 个缺陷修复 🐞。

ClickHouseDB的博客 1394

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

ClickHouse 25.8 版本发布说明

ClickHouse 25.8 版本共带来了 45 项新功能 🌻、47 项性能优化 🏍 和 119 个 bug 修复 🐝

ClickHouseDB的博客 1226

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ClickHouse 25.6 版本发布说明

本次ClickHouse 25.6 发布包含 25 项新功能 🌸 32 项性能优化 🦋 以及 105 个缺陷修复 🐝。

ClickHouseDB的博客 1249

ClickHouse 25.1 版本发布说明

本文字数:12318;估计阅读时间:31 分钟作者: ClickHouse Team本文在公众号【ClickHouseInc】首发又到了每月发布新版本的时间!发布概要ClickHouse 25.1 版本正式发布,本次更新带来了🦃、在本次发布中,我们优化了并行哈希连接算法,引入了二级哈希表进行加速;在表级别新增了 MinMax 索引;改进了 Merge 表;增加了自增功能……还有更多精彩更新等你探索!热烈欢迎 25.1 版本的新贡献者!

ClickHouseDB的博客 1841

ClickHouse 25.4 版本发布说明

ClickHouse 25.4 带来了 25 项新功能 🌸 23 项性能优化 🦋 以及 58 个缺陷修复 🐝

ClickHouseDB的博客 1467

ClickHouse 24.10 版本发布说明

本文字数:13817;估计阅读时间:35 分钟作者:ClickHouse Team本文在公众号【ClickHouseInc】首发又到了新版本发布的时间!本次ClickHouse 24.10 版本包含了🎁、🛷、🐛在本次发布中,clickhouse-local 更加实用,新增了复制和计算器模式。可刷新物化视图已达到生产就绪标准,远程文件支持缓存,表克隆操作也得到了简化。正如往常,我们热烈欢迎所有 24.9 版本中的新贡献者!

ClickHouseDB的博客 1746

ClickHouse 25.12 版本发布说明

ClickHouse 25.12 版本带来了 26 项新特性 🎄、31 项性能优化 ⛸,以及 129 个 bug 修复 ☃

ClickHouseDB的博客 940

ClickHouse 23.11 版本发布说明

23.11版本新增25个新功能,实现了24项性能优化,修复了70处bug。

ClickHouseDB的博客 1436

ClickHouse 26.2 版本发布说明

ClickHouse 26.2 来了!在本文中,文本索引和 QBit 数据类型达到生产就绪状态。

ClickHouseDB的博客 635

ClickHouse 23.9 版本发布说明

我们非常兴奋地分享了23.9版本中一系列令人惊叹的功能特性。

ClickHouseDB的博客 607

ClickHouse版本迁移实战:企业级升级与回滚最佳实践

ClickHouse作为现代大数据分析型数据库管理系统,其版本迭代频率高、功能更新快,为企业用户带来性能提升的同时也带来了版本管理的挑战。本文深度解析ClickHouse版本迁移的核心策略,提供生产环境下的实战指南。 ## 版本演进与兼容性挑战 ClickHouse采用双轨发布策略:**稳定版(Stable)** 和 **长期支持版(LTS)**。根据变更日志分析,2025年已发布v25.9至

gitblog_00864的博客 484

ClickHouse 26.3 版本发布说明:异步插入默认开启,JOIN重排序更智能!

ClickHouse 26.3重磅发布!异步插入默认启用,新增JOIN重排序与物化CTE,性能与易用性再升级。

ClickHouseDB的博客 596
上一篇: 解锁 ClickHouse 新技能: JSON 数据性能调优,实时获取业务洞察
下一篇: ClickHouse 查询提速新武器:查询条件缓存
ClickHouseDB
博客等级 码龄3年 1707粉丝 320原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值