Skip to content

Instantly share code, notes, and snippets.

"""Matrix square roots with backward passes.
Cleaned up from https://github.com/msubhransu/matrix-sqrt.
"""
import torch
def sqrtm_ns(a, num_iters=10):
if a.ndim < 2:
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active December 18, 2024 02:15
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',