Loss landscapes are a powerful tool for understanding neural network optimization and generalization, yet traditional low-dimensional analyses often miss complex topological features. We present Landscaper, an open-source Python package for arbitrary-dimensional loss landscape analysis. Landscaper combines Hessian-based subspace construction with topological data analysis to reveal geometric structures such as basin hierarchy and connectivity. A key component is the Saddle-Minimum Average Distance (SMAD) for quantifying landscape smoothness. We demonstrate Landscaper's effectiveness across various architectures and tasks, including those involving pre-trained language models, showing that SMAD captures training transitions, such as landscape simplification, that conventional metrics miss. We also illustrate Landscaper's performance in challenging chemical property prediction tasks, where SMAD can serve as a metric for out-of-distribution generalization, offering valuable insights for model diagnostics and architecture design in data-scarce scientific machine learning scenarios.
翻译:损失函数景观是理解神经网络优化与泛化能力的有力工具,但传统的低维分析常忽略复杂的拓扑特征。本文提出Landscaper——一个用于任意维度损失函数景观分析的开源Python工具包。Landscaper将基于Hessian矩阵的子空间构建与拓扑数据分析相结合,以揭示盆地层次结构与连通性等几何特征。其核心组件是用于量化景观平滑度的鞍点-极小值平均距离(SMAD)指标。我们在多种架构与任务中验证了Landscaper的有效性,包括涉及预训练语言模型的任务,结果表明SMAD能捕捉传统指标忽略的训练动态(如景观简化现象)。我们还展示了Landscaper在具有挑战性的化学性质预测任务中的表现,其中SMAD可作为分布外泛化的评估指标,为数据稀缺的科学机器学习场景中的模型诊断与架构设计提供重要洞见。