首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏不止于python

    极致优化:Python 实战教你高效转换 FITS 图像并精确标注坐标

    本文示例代码中主要使用了以下工具: • astropy.io.fits:读取 FITS 数据 • astropy.visualization.ZScaleInterval:智能拉伸图像对比度 • matplotlib 参数: - fits_file: str, FITS 文件路径 - output_file: str, 输出图片文件路径(.png 或 .jpg) - xy_coords: list 数据 with fits.open(fits_file) as hdul: data = hdul[0].data # 获取主扩展的数据 # 计算图像显示的亮度区间 使用内存映射(Memory Mapping)读取 FITS 文件 对于大型 FITS 文件,可以使用 memmap=True 进行内存映射,以加快数据读取速度。 with fits.open(fits_file, memmap=True) as hdul: data = hdul[0].data 但是有时会出现如下错误: ValueError: Cannot

    80700编辑于 2025-03-17
  • 来自专栏IT从业者张某某

    seaborn从入门到精通03-绘图功能实现04-回归拟合绘图Estimating regression fits

    seaborn从入门到精通03-绘图功能实现04-回归拟合绘图Estimating regression fits 总结 本文主要是seaborn从入门到精通系列第3篇,本文介绍了seaborn的绘图功能实现 It fits and removes a simple linear regression and then plots the residual values for each observation regplot() always shows a single relationship, lmplot() combines regplot() with FacetGrid to show multiple fits

    52820编辑于 2023-10-16
  • 来自专栏科学最Top

    时序必读论文13|ICLR24 “又好又快”的线性SOTA时序模型FITS

    论文标题:FITS: Modeling Time Series with 10k Parameters 开源代码:https://anonymous.4open.science/r/FITS/README.md FITS模型 关于模型推荐大家结合代码来看,非常清晰,FITS的流程如图所示: 首先对于长度为L的序列,作者首先进行了RIN归一化,目的是为了使序列均值为0,然后使用傅立叶变换rFFT把时域信息转到频域 从上面的流程来看,整个FITS的核心就是三部分:傅立叶变换、复频率线性插值和低通滤波。我们着重看一下低通滤波,即到底应该过滤掉多少高频的频域信息。 FITS对比试验 在模型参数量大大减少的情况下,FITS和Patch TST互有胜负,模型算是SOTA了。在比较推理速度,FITS的优势就出来了。 FITS总结 对于我们大多数普通团队来说,时间序列研究想从纯算法的角度SOTA好难。

    90010编辑于 2024-09-18
  • 来自专栏深度学习与python

    对话黄东旭、关涛、李远策:数据引擎,One Size Fits All 真的能实现么?

    今天,数据平台是企业的必选项。长期以来,企业在选择数据平台架构时,多倾向于针对流处理和批处理两大场景分别部署两套方案。近年来,一体化数据融合平台的概念逐渐受到关注,行业开始尝试在同一个架构中同时处理不同类型的数据,简化数据平台技术栈。那么企业真的可以使用一套解决方案应对所有场景吗?一体化数据平台有哪些主流选项?Lambda 与 Kappa 架构各有哪些优势和不足?企业该如何选择适合自己的解决方案?

    42230编辑于 2023-08-09
  • 来自专栏IT从业者张某某

    seaborn从入门到精通03-绘图功能实现04-回归拟合绘图Estimating regression fits

    seaborn从入门到精通03-绘图功能实现04-回归拟合绘图Estimating regression fits 总结 本文主要是seaborn从入门到精通系列第3篇,本文介绍了seaborn的绘图功能实现 It fits and removes a simple linear regression and then plots the residual values for each observation regplot() always shows a single relationship, lmplot() combines regplot() with FacetGrid to show multiple fits

    55510编辑于 2023-10-16
  • 来自专栏生信菜鸟团

    R tips:解决monocle的plot_genes_branched_heatmap函数报错

    newdata = newdata, type = response_type) } } }, mc.cores = cores) 8: responseMatrix(list(model_fits ), new_data, response_type = response_type) 7: as.data.frame(responseMatrix(list(model_fits), new_data = relative_expr, disp_func = cds@dispFitInfo[["blind"]]$disp_func) if (is.null(model_fits <- length(res_list[is.na(res_list)]) if (num_na_fits > 0) { na_matrix <- matrix(rep(rep(NA , res_list_lengths[[1]]), num_na_fits), nrow = num_na_fits) row.names(na_matrix

    64100编辑于 2025-04-13
  • 来自专栏数据结构和算法

    使用Python实现天文数据分析:探索宇宙的奥秘

    from astropy.io import fits import pandas as pd # 读取FITS文件 def read_fits(file_path): hdul = fits.open (file_path) data = hdul[1].data hdul.close() return data # 示例:读取天文数据 fits_data = read_fits ['luminosity'] = calculate_luminosity(fits_data) print(fits_data['luminosity'].head()) # 计算光谱特征 def ['peak_wavelength'] = calculate_spectral_features(fits_data) print(fits_data['peak_wavelength'].head( 案例分析 # 读取实际观测数据 observed_data = read_fits('observed_data.fits') # 数据处理 observed_data['luminosity'] =

    50010编辑于 2024-12-20
  • 来自专栏狼王编程之路

    设计模式系列| 适配器模式

    (roundNails)) { System.out.println("this round nails is fits"); } else { System.out.println("this round nails is does not fits"); } //10方钉是否合适 if (roundHold.fits ("squareNails10 is does not fits"); } //6方钉是否合适 if (roundHold.fits(result6)) ("squareNails6 is does not fits"); } } } 结果: this round nails is fits squareNails10 is does not fits squareNails6 is fits 4、总结 优点: 1)单一原则:将代码或者数据转换的过程从主要业务逻辑区分出来。

    41930发布于 2021-06-01
  • 来自专栏气python风雨

    天文观测数据分析:利用Astrometry API自动添加WCS信息

    代码实现:自动添加WCS信息 以下代码展示了如何利用Astrometry的API,自动上传FITS文件并获取WCS信息,最终将其写入原始文件中。 上传FITS文件:将观测数据上传到Astrometry服务器。 获取任务ID:提交任务并获取任务ID,用于轮询任务状态。 下载WCS信息:任务完成后,下载包含WCS信息的FITS文件。 合并WCS信息:将WCS信息写入原始FITS文件。 API密钥 FITS_FILE = r'fts\29P Schwassmann-Wachmann_15s60_Astro_20250223-222729644_0C.fits'# 输入FITS文件路径 (FITS_FILE, mode='update') as orig_hdu, fits.open(wcs_filename) as wcs_hdu: orig_header = orig_hdu

    55600编辑于 2025-02-27
  • 来自专栏算法与数据结构

    PTA 堆栈操作合法性(20 分)

    Stack Sta; InitStack(Sta); //cout<<Sta.sta_len<<" "<<Sta.ElemNumber<<endl; bool Fits ]=='S') { if(Sta.ElemNumber==Len) { Fits int Ans = Pop(Sta); if(Ans==-1) { Fits false; break; } } } if(Sta.ElemNumber) Fits = false; if(Fits) cout<<"YES"<<endl; else cout<<"NO"<<endl;

    2.8K80发布于 2017-12-29
  • 来自专栏R语言及实用科研软件

    🤩 Monocle 3 | 太牛了!单细胞必学R包!~(四)(差异分析之建模与评估)

    "ham-1") cds_subset <- cds[rowData(cds)$gene_short_name %in% ciliated_genes,] gene_fits fit_coefs <- coefficient_table(gene_fits) DT::datatable(fit_coefs) 我们提取一下时间项。 embryo.time.bin", ncol=2) + theme(axis.text.x=element_text(angle=45, hjust=1)) 5控制批次效应和混杂因素 gene_fits fit_models(cds_subset, model_formula_str = "~embryo.time + batch") fit_coefs <- coefficient_table(gene_fits = "(Intercept)") %>% select(gene_short_name, term, q_value, estimate) 6评估模型 evaluate_fits(gene_fits

    1.9K50编辑于 2023-11-16
  • 来自专栏DeepHub IMBA

    LSTM时间序列预测中的一个常见错误以及如何修正

    epochs=500, batch_size=18, verbose=2) # Make predictions forecasts = model.predict(X_test) lstm_fits date_range = pd.date_range(start='1990-01-01', end='2023-09-30', freq='M') # Add empty values in fits ): fits[i+look_back] = lstm_fits[i] # Plot actual, fits, and forecasts plt.figure(figsize=(10 6)) plt.plot(date_range, ts_data, label='Actual', color='blue') plt.plot(date_range[:train_size], fits = model.predict(X)[:train_size-n_steps_in,0] forecasts12 = lstm_predictions[:,n_steps_out-1] fits12

    1.3K21编辑于 2024-05-10
  • 来自专栏科学最Top

    影响6个时序Baselines模型的代码Bug

    前言 我是从去年年底开始入门时间序列研究,但直到最近我读FITS这篇文章的代码时,才发现从去年12月25号就有人发现了数个时间序列Baseline的代码Bug。 affected code Fedformer (ICML 2022) - Link to affected code FiLM (ICLR 2023) - Link to affected code FITS 参考链接:https://anonymous.4open.science/r/FITS/README.md 错误描述 这个错误源于数据加载器中的错误实现。 FITS(假设是指某个时间序列预测模型)仍然保持了足够好且与其他最先进模型相媲美的性能。 从更新后的结果我们发现,最能打还是Patch TST以及FITS

    20510编辑于 2024-09-18
  • 来自专栏时空探索之旅

    AI论文速读 | 线性时间序列预测模型分析

    FITS的性能令人印象深刻,在最佳超参数设置下达到或接近最先进的性能。 讨论和局限性:论文讨论了分析的局限性,并提出了未来工作的方向,例如探索FITS技术压缩OLS解的可能性。 偏差参数比较:比较了不同模型学习到的偏差参数,并发现FITS+IN的偏差参数与其他模型有显著不同,这与论文的理论分析相符。 A: 论文在讨论部分提出了一些可以进一步探索的点,包括: 模型压缩:FITS模型允许在训练期间通过忽略高频成分来压缩模型。 未来工作:论文讨论了其分析的局限性,并提出了未来研究的方向,例如探索FITS技术在压缩OLS解中的应用潜力。

    51410编辑于 2024-11-19
  • 来自专栏everhad

    ImageView缩放选项

    Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits

    1.9K70发布于 2018-01-08
  • 来自专栏时空探索之旅

    ICLR 2026 | MixLinear 时频互补 双域融合,0.1K 参数极端低资源下的多元时间序列预测

    这两类特征是互补的,却被现有模型用同一套架构强行建模: 纯时域模型(DLinear、SparseTSF):难以捕捉全局周期性; 纯频域模型(FITS):难以刻画局部尖锐波动; Transformer 类 以 720 步预测 horizon 为例,横向对比如下: 模型 参数量 类型 MixLinear ~176 个(0.1K) 双路径线性 SparseTSF ~1,000 个(1K) 稀疏线性 FITS 5.2 计算效率:速度快 2-3 倍 MACs(乘积累加操作)对比(720 horizon): 场景 MixLinear SparseTSF FITS ETTh1(低维) 196.56K 277.20K 292.32K Traffic(高维) 24.2M 34.14M 36.00M MixLinear的MACs比SparseTSF低约41%,比FITS低约 49%。 推理速度对比: 场景 MixLinear SparseTSF FITS Exchange(低维) 0.25ms 快 3.2× 快 1.72× Electricity(高维) 2.05ms 快 2.12×

    18010编辑于 2026-03-10
  • 来自专栏科学最Top

    近期值得关注的3个线性时序模型及其未来发展综述

    2、FITS 论文标题:FITS: MODELING TIME SERIES WITH 10k PARAME-TERS(ICLR2024) 作者提出一个轻量级时序分析模型FITSFITS线性架构非常简洁,核心是复数值线性层,用于学习振幅缩放和相位偏移,通过在复频域中进行插值,集成低通滤波器,使其得以保留关键信息,并能达到最先进的性能水平。 值得注意的是,FITS不到10k个参数,比前文的DLinear紧凑50倍,并且大约比其他主流模型小10,000倍。鉴于其在内存和计算方面的效率,FITS成为部署甚至直接在边缘设备上训练的理想选择。

    53210编辑于 2024-09-18
  • 来自专栏python3

    遗传算法(python版)

    key = itemgetter("fitness"), reverse=True)#sort the pop by the reference of 1/fitness sum_fits pop chosen = [] for i in xrange(k): u = random.random() * sum_fits #randomly produce a num in the range of [0, sum_fits] sum_ = 0 for ind in s_inds ) / length sum2 = sum(x*x for x in fits) std = abs(sum2 / length - mean**2)** )) print(" Max fitness of current pop: %s" % max(fits)) print(" Avg fitness

    1.9K21发布于 2020-01-06
  • 来自专栏AiCharm

    每日学术速递2.27

    Subjects: cs.CL 1.FiTs: Fine-grained Two-stage Training for Knowledge-aware Question Answering 标题:FiTs Weiyuan Xu, Yuexian Zou 文章链接:https://arxiv.org/abs/2302.11799v1 项目代码:https://github.com/yeeeqichen/fits 为了解决上述两个问题,我们提出了一个细粒度的两阶段训练框架(FiTs)来提高 KAQA 系统的性能:第一阶段旨在对齐来自 PLM 和 KG 的表示,从而弥合它们之间的模态差距,命名为知识自适应后训练。

    29920编辑于 2023-05-15
  • 来自专栏DeepHub IMBA

    使用Scikit-Learn的HalvingGridSearchCV进行更快的超参数调优

    assign(RMSLE=-full_results.best_score_) Fitting 3 folds for each of 81 candidates, totalling 243 fits iter: 0 n_candidates: 81 n_resources: 365 Fitting 3 folds for each of 81 candidates, totalling 243 fits iter: 1 n_candidates: 41 n_resources: 730 Fitting 3 folds for each of 41 candidates, totalling 123 fits iter: 2 n_candidates: 21 n_resources: 1460 Fitting 3 folds for each of 21 candidates, totalling 63 fits iter: 0 n_candidates: 81 n_resources: 250 Fitting 3 folds for each of 81 candidates, totalling 243 fits

    1K30发布于 2021-07-01
领券