Image Classification
Transformers
Safetensors
nula
computer-vision
cnn
cifar10
adversarial-robustness
stress-test
downsampling
anti-aliasing
custom_code
Instructions to use MamaPearl/nula-cifar10-robust-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MamaPearl/nula-cifar10-robust-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="MamaPearl/nula-cifar10-robust-v0", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("MamaPearl/nula-cifar10-robust-v0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_nula.py
Browse files- modeling_nula.py +2 -2
modeling_nula.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import torch
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
from transformers import PreTrainedModel
|
|
@@ -99,7 +99,7 @@ class NULAConvBlock(nn.Module):
|
|
| 99 |
out = self.out_act(out)
|
| 100 |
return out
|
| 101 |
|
| 102 |
-
class
|
| 103 |
config_class = NULAConfig
|
| 104 |
base_model_prefix = "nula"
|
| 105 |
|
|
|
|
| 1 |
+
import torch as pt
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
from transformers import PreTrainedModel
|
|
|
|
| 99 |
out = self.out_act(out)
|
| 100 |
return out
|
| 101 |
|
| 102 |
+
class NulaForImageClassification(PreTrainedModel):
|
| 103 |
config_class = NULAConfig
|
| 104 |
base_model_prefix = "nula"
|
| 105 |
|