🚀 Feature
Why not implement some common metrics, to evaluate models, with strong GPU acceleration.
Motivation
When I need to evaluate model accuracy (ex. measure r squared) I have to write it by hand, or use Numpy or other library (without GPU support). It'd be cleaner and simpler to have dedicated package with Pytonic API. It could also provide performance benefits because of low-level (c++) optimizations.
Pitch
I'd like to have some package ex: torch.metrics then I could do something like:
from torch.metrics import RSquaredMetric
metric = RSquaredMetric()
out = model(input)
r_squared = metric(out, reference)
Or I could do:
from torch.metrics import MSEMetric
metric = MSEMetric()
out = model(input)
mse = metric(out, reference)
Alternatives
For now, I can use some Tensors modifications or use Numpy:
ref_val = reference_batch[key].cpu().detach().numpy()
cor_matrix = np.corrcoef(val, ref_val, rowvar=False)
n = cor_matrix.shape[0] // 2
out_r2[key] = [cor_matrix[i][i + n] for i in range(n)]
If you agree, I'd like to contribute.
cc @ezyang @gchanan @zou3519 @albanD @mruberry
🚀 Feature
Why not implement some common metrics, to evaluate models, with strong GPU acceleration.
Motivation
When I need to evaluate model accuracy (ex. measure r squared) I have to write it by hand, or use Numpy or other library (without GPU support). It'd be cleaner and simpler to have dedicated package with Pytonic API. It could also provide performance benefits because of low-level (c++) optimizations.
Pitch
I'd like to have some package ex:
torch.metricsthen I could do something like:Or I could do:
Alternatives
For now, I can use some Tensors modifications or use Numpy:
If you agree, I'd like to contribute.
cc @ezyang @gchanan @zou3519 @albanD @mruberry