1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
//! # 可視化ツール / Visualization Tools
//!
//! RusTorchの包括的な可視化機能を提供するモジュールです。
//! 機械学習のワークフロー全体にわたって、データの理解とモデルの解釈を支援します。
//!
//! This module provides comprehensive visualization capabilities for RusTorch,
//! supporting data understanding and model interpretation throughout the machine learning workflow.
//!
//! ## ✨ Features / 機能
//!
//! - **📈 Training Curves**: Loss and metrics visualization with customizable styling
//! - **🔢 Tensor Visualization**: Heatmaps, bar charts, and 3D slice views
//! - **🕸️ Computation Graphs**: SVG and DOT format graph visualization
//! - **🎨 Color Palettes**: Professional colormaps (Viridis, Plasma, Jet, etc.)
//! - **📊 Dashboard Creation**: Multi-plot HTML dashboards
//! - **💾 Multiple Formats**: SVG, HTML, DOT output support
//!
//! ## 🚀 Quick Start / クイックスタート
//!
//! ```no_run
//! use rustorch::visualization::*;
//! use rustorch::models::high_level::TrainingHistory;
//! use rustorch::tensor::Tensor;
//! use rustorch::autograd::Variable;
//! use std::collections::HashMap;
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create sample training history
//! let mut history = TrainingHistory::<f32>::new();
//! history.add_epoch(1.0, Some(1.2), HashMap::new());
//!
//! // Training curve visualization
//! let plotter = TrainingPlotter::new();
//! let svg = plotter.plot_training_curves(&history)?;
//!
//! // Tensor visualization
//! let tensor = Tensor::from_vec(vec![1.0f32, 2.0, 3.0, 4.0], vec![2, 2]);
//! let viz = TensorVisualizer::new();
//! let heatmap = viz.plot_heatmap(&tensor)?;
//!
//! // Computation graph
//! let variable = Variable::new(tensor, true);
//! let mut graph_viz = GraphVisualizer::new();
//! graph_viz.build_graph(&variable)?;
//! let graph_svg = graph_viz.to_svg();
//!
//! Ok(())
//! }
//! ```
//!
//! ## 📊 Supported Visualizations / 対応する可視化
//!
//! | Type | Description | Output Formats |
//! |------|-------------|----------------|
//! | Training Curves | Loss and metrics over time | SVG, HTML |
//! | Tensor Heatmaps | 2D tensor value visualization | SVG, HTML |
//! | Bar Charts | 1D tensor value distribution | SVG, HTML |
//! | 3D Slices | Multi-dimensional tensor slicing | SVG, HTML |
//! | Computation Graph | Variable and operation flow | SVG, DOT |
//! | Dashboard | Multi-plot combination view | HTML |
/// 学習曲線のプロット機能
/// Training curve plotting functionality
/// テンソルの可視化機能
/// Tensor visualization functionality
/// 計算グラフの可視化機能
/// Computation graph visualization functionality
/// 可視化ユーティリティ
/// Visualization utilities
/// 可視化機能の統合テスト
/// Visualization integration tests
// Re-export main visualization types
pub use ;
pub use ;
pub use ;
pub use ;
use crateRusTorchResult; // RusTorchError,
use Float;
use HashMap;
// PlotData is defined later with generic type parameter
// TensorSpec is defined in model_import::mod - import when needed
pub use crateTensorSpec;
// VisualizationError enum removed - now using unified RusTorchError system
// VisualizationErrorエナム削除 - 統一RusTorchErrorシステムを使用
// 可視化結果 (統一済み)
// Visualization result (統一済み)
// RusTorchResult already imported - no need to redefine
/// 基本的な可視化トレイト
/// Base visualization trait
/// プロットデータ
/// Plot data structure
/// メタデータ
/// Metadata for plots