Downloads · 30 days
58
100% of all-time downloads
taceroc/ML_RealBogus_Rubin
ML_RealBogus_Rubin is a machine learning model from taceroc. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-4.0.
This model has been pushed to the Hub using the PytorchModelHubMixin integration: - Code:
Downloads · 30 days
58
100% of all-time downloads
All-time downloads
58
Public
Parameters
73.6K
3.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.zip2.5 MB · 89%
From the Hugging Face model README
This model has been pushed to the Hub using the PytorchModelHubMixin integration:
Code:
Each version tag (v0.1, v0.2, v0.3) match the versioning schema introduced and described in DMTN-337
import torch
import torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin
class TACCNN(nn.Module,PyTorchModelHubMixin):
def __init__(self, input_shape=(3, 51, 51)):
super(TACCNN, self).__init__()
self.conv1 = nn.Conv2d(input_shape[0], 16, kernel_size=5, stride=1)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(16, 32, kernel_size=5, stride=1)
self.conv3 = nn.Conv2d(32, 64, kernel_size=5, stride=1)
self.dropout1 = nn.Dropout(0.4)
self.dropout2 = nn.Dropout(0.4)
self.dropout3 = nn.Dropout(0.4)
dummy_input = torch.randn(1, input_shape[0], input_shape[1], input_shape[2])
self.forward_conv(dummy_input)
self.fc1 = nn.Linear(self.num_shape[1], 32)
self.fc2 = nn.Linear(32, 1)
def forward_conv(self, x):
x = self.pool(nn.functional.relu(self.conv1(x)))
x = self.pool(nn.functional.relu(self.conv2(x)))
x = self.pool(nn.functional.relu(self.conv3(x)))
x = torch.flatten(x, 1)
self.num_shape = x.size()
def forward(self, x):
x = self.pool(nn.functional.relu(self.conv1(x)))
x = self.dropout1(x)
x = self.pool(nn.functional.relu(self.conv2(x)))
x = self.dropout2(x)
x = self.pool(nn.functional.relu(self.conv3(x)))
x = self.dropout3(x)
x = torch.flatten(x, 1)
x = nn.functional.relu(self.fc1(x))
x = self.fc2(x)
return nn.functional.sigmoid(x).squeeze(1)
# load v01
print('v01')
model = TACCNN.from_pretrained("taceroc/test_rubin_model", revision='v0.1')
model.eval()
print(model)
torch.manual_seed(2)
print(model(torch.rand(1,3, 51, 51)))
# load v02
print('v02')
model = TACCNN.from_pretrained("taceroc/test_rubin_model", revision='v0.2')
model.eval()
print(model)
torch.manual_seed(2)
print(model(torch.rand(1,3, 51, 51)))
# load v03
print('v03')
model = TACCNN.from_pretrained("taceroc/test_rubin_model", revision='v0.3')
model.eval()
print(model)
torch.manual_seed(2)
print(model(torch.rand(1,3, 51, 51)))
Paper: [More Information Needed]
Docs: [More Information Needed]