Run this model with HF Jobs
Run adamdad/kat_small_patch16_224 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/adamdad/kat_small_patch16_224. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/adamdad/kat_small_patch16_224 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use adamdad/kat_small_patch16_224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use adamdad/kat_small_patch16_224 with timm:
import timm model = timm.create_model("hf-hub:adamdad/kat_small_patch16_224", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Model card for kat_small_patch16_224
KAT model trained on ImageNet-1k (1 million images, 1,000 classes) at resolution 224x224. It was first introduced in the paper Kolmogorov–Arnold Transformer.
Model description
KAT is a model that replaces channel mixer in transfomrers with Group Rational Kolmogorov–Arnold Network (GR-KAN).
Usage
The model definition is at https://github.com/Adamdad/kat, katransformer.py.
from urllib.request import urlopen
from PIL import Image
import timm
import torch
import katransformer
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
# Move model to CUDA
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = timm.create_model("hf_hub:adamdad/kat_small_patch16_224", pretrained=True)
model = model.to(device)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0).to(device)) # unsqueeze single image into batch of 1
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
print(top5_probabilities)
print(top5_class_indices)
Bibtex
@misc{yang2024compositional,
title={Kolmogorov–Arnold Transformer},
author={Xingyi Yang and Xinchao Wang},
year={2024},
eprint={XXXX},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
- Downloads last month
- 5