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

网站维护模式移动网站适配

网站维护模式,移动网站适配,廊坊企业网站排名优化,做游戏 做网站本文翻译整理自:https://github.com/amazon-science/chronos-forecasting 文章目录 一、关于 Chronos相关链接资源关键功能特性 二、安装1、基础安装2、开发模式安装 三、基本使用1、时间序列预测2、提取编码器嵌入 四、模型架构五、零样本性能六、最佳实践七、数据…

在这里插入图片描述本文翻译整理自:https://github.com/amazon-science/chronos-forecasting

文章目录

    • 一、关于 Chronos
      • 相关链接资源
      • 关键功能特性
    • 二、安装
      • 1、基础安装
      • 2、开发模式安装
    • 三、基本使用
      • 1、时间序列预测
      • 2、提取编码器嵌入
    • 四、模型架构
    • 五、零样本性能
    • 六、最佳实践
    • 七、数据集


一、关于 Chronos

Chronos 是基于语言模型架构的预训练时间序列预测模型家族。
通过量化和缩放将时间序列转换为token序列,使用交叉熵损失训练语言模型。
训练完成后,通过给定历史上下文采样多个未来轨迹来获得概率预测。
Chronos 模型已在大量公开时间序列数据以及高斯过程生成的合成数据上进行训练。

在这里插入图片描述


相关链接资源

  • github : https://github.com/amazon-science/chronos-forecasting
  • 官网:https://www.amazon.science/blog/adapting-language-model-architectures-for-time-series-forecasting
  • 官方文档:https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html
  • Paper : https://arxiv.org/abs/2403.07815
  • Demo/在线试用:https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444
  • Hugging Face : https://huggingface.co/datasets/autogluon/chronos_datasets
  • Community : https://github.com/amazon-science/chronos-forecasting/issues
  • Blog : https://towardsdatascience.com/chronos-the-rise-of-foundation-models-for-time-series-forecasting-aaeba62d9da3
  • FAQ : https://github.com/amazon-science/chronos-forecasting/issues?q=is%3Aissue+label%3AFAQ
  • License : https://opensource.org/licenses/Apache-2.0

关键功能特性

  • 基于T5架构的预训练时间序列模型
  • 支持零样本(zero-shot)预测
  • 提供多种模型尺寸选择(8M~710M参数)
  • 支持概率预测和分位数输出
  • 可提取编码器嵌入特征
  • 支持SageMaker生产部署

二、安装

1、基础安装

pip install chronos-forecasting

2、开发模式安装

git clone https://github.com/amazon-science/chronos-forecasting.git
cd chronos-forecasting && pip install --editable ".[training]"

三、基本使用

1、时间序列预测

import pandas as pd
import torch
from chronos import BaseChronosPipelinepipeline = BaseChronosPipeline.from_pretrained("amazon/chronos-t5-small",device_map="cuda",torch_dtype=torch.bfloat16,
)df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")quantiles, mean = pipeline.predict_quantiles(context=torch.tensor(df["#Passengers"]),prediction_length=12,quantile_levels=[0.1, 0.5, 0.9],
)

对于原始的Chronos模型,可以使用 pipeline.reduce 来绘制预测样本。在 pipeline.product_quantiles中,可以找到更多关于 predict_wargs的选项:

from chronos import ChronosPipeline, ChronosBoltPipelineprint(ChronosPipeline.predict.__doc__)  # for Chronos models
print(ChronosBoltPipeline.predict.__doc__)  # for Chronos-Bolt models

我们现在可以将预测可视化:

import matplotlib.pyplot as plt  # requires: pip install matplotlibforecast_index = range(len(df), len(df) + 12)
low, median, high = quantiles[0, :, 0], quantiles[0, :, 1], quantiles[0, :, 2]plt.figure(figsize=(8, 4))
plt.plot(df["#Passengers"], color="royalblue", label="historical data")
plt.plot(forecast_index, median, color="tomato", label="median forecast")
plt.fill_between(forecast_index, low, high, color="tomato", alpha=0.3, label="80% prediction interval")
plt.legend()
plt.grid()
plt.show()

2、提取编码器嵌入

import pandas as pd
import torch
from chronos import ChronosPipelinepipeline = ChronosPipeline.from_pretrained("amazon/chronos-t5-small",device_map="cuda",torch_dtype=torch.bfloat16,
)df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")# context must be either a 1D tensor, a list of 1D tensors,
# or a left-padded 2D tensor with batch as the first dimension
context = torch.tensor(df["#Passengers"])
embeddings, tokenizer_state = pipeline.embed(context)

四、模型架构

Chronos基于T5架构,主要差异在于词汇表大小(4096 vs 原版32128),减少了参数量。

模型参数量基础架构
chronos-t5-tiny8Mt5-efficient-tiny
chronos-t5-mini20Mt5-efficient-mini
chronos-t5-small46Mt5-efficient-small
chronos-t5-base200Mt5-efficient-base
chronos-t5-large710Mt5-efficient-large
chronos-bolt-tiny9Mt5-efficient-tiny
chronos-bolt-mini21Mt5-efficient-mini
chronos-bolt-small48Mt5-efficient-small
chronos-bolt-base205Mt5-efficient-base

五、零样本性能

Chronos在27个未见数据集上展现出卓越的零样本预测能力,优于本地统计模型和任务特定模型。


在这里插入图片描述


六、最佳实践

1、生产部署推荐:

  • 使用AutoGluon进行微调和集成
  • 通过SageMaker JumpStart部署推理端点

2、性能优化:

  • Apple Silicon设备可使用MLX加速
  • Chronos-Bolt模型比原版快250倍

七、数据集

训练和评估数据集可通过HuggingFace获取:

  • https://huggingface.co/datasets/autogluon/chronos_datasets
  • https://huggingface.co/datasets/autogluon/chronos_datasets_extra

伊织 xAI 2025-04-17(四)

http://www.dtcms.com/a/479754.html

相关文章:

  • 营销网站建设的目的北京百度总部电话
  • C++STL---静态数组array
  • 东莞樟木头网站设计使用vue做简单网站教程
  • 济南想建设网站长宁网站建设价格
  • 【开题答辩全过程】以 保定基于java的超市库存管理系统为例,包含答辩的问题和答案
  • 设计好的建设专业网站上海新建设建筑设计有限公司网站
  • 建立一个团购网站需要多少钱昭通微网站建设
  • 基于 Oracle 数据泵(expdp/impdp) 的数据导入导出
  • Oracle RAC Global Cache Load Profile
  • 关于做网站的毕业设计如何制作简单的网站
  • AI大模型的市场目前怎么样?
  • self attention, masked self attention, cross attention
  • 基于51单片机心率温度语音播报、显示时间
  • 商城网站建设公司招聘北京房产网北京二手房
  • 前端图片加载失败、 img 出现裂图的原因全解析
  • Linux——进程优先级
  • 宝塔面板建设二级域名网站访问不了网站建设需
  • wordpress 会被墙吗福田企业网站优化排名
  • ftp上传网站社群营销与运营
  • 吉林网站建设费用接推广是什么意思
  • 如何做营销型网站人工智能的关键词
  • 旅游网站的设计栏目动易网站系统怎么样
  • 上海网站制作建设多少钱.net 快速网站开发
  • 网站营销活动策划wordpress制作网页教程
  • 如何完整保存网站并做修改中企动力邮箱网页版
  • 网站模板下载破解版廊坊那家做网站排行榜
  • 深圳网站设计九曲个人小说网站怎么做
  • 沈阳网站建设024wwordpress 会员登录
  • 【开题答辩全过程】以 濒危动物保护管理系统为例,包含答辩的问题和答案
  • VS Code 智能提示(IntelliSense)完全配置指南(C++/Python/JavaScript)