Views
No views yet
1GAT(
2 input_dim=N/A,
3 hidden_dim=512,
4 out_dim=768,
5 num_layers=3,
6 num_heads=4,
7 dropout=0.1,
8 pooling='mean'
9)1import torch
2from torch_geometric.data import Data
3from huggingface_hub import hf_hub_download
4
5# Download model files
6checkpoint_path = hf_hub_download(
7 repo_id="NicolasNoya/molecule-gat-contrastive",
8 filename="model.pt"
9)
10
11# Load checkpoint
12checkpoint = torch.load(checkpoint_path, map_location='cpu')
13
14# Reconstruct model (you'll need the model class definition)
15# See model_architecture.py in this repo
16
17model = MolGAT(
18 input_dim=N/A,
19 hidden_dim=512,
20 out_dim=768,
21 num_layers=3,
22 num_heads=4,
23 dropout=0.1,
24 pooling='mean'
25)
26
27model.load_state_dict(checkpoint['model_state_dict'])
28model.eval()
29
30# Use the model
31with torch.no_grad():
32 # graph_data should be a PyTorch Geometric Data object
33 embedding = model(graph_data)1@misc{molecule_gat_2025,
2 author = {NicolasNoya},
3 title = {Molecule GAT for Contrastive Learning},
4 year = {2025},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/NicolasNoya/molecule-gat-contrastive}}
7}