Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import torch_geometric.transforms as T
|
|
13 |
from torch_geometric.nn import LightGCN
|
14 |
import utils
|
15 |
|
16 |
-
device = torch.device('
|
17 |
data = torch.load("processed_MVL_light.pt")
|
18 |
ch = torch.load('./lightGCNModel_num_layers_MovieLens100K_checkpoint.pt')
|
19 |
lightGCNModel = LightGCN(
|
@@ -21,11 +21,12 @@ lightGCNModel = LightGCN(
|
|
21 |
embedding_dim=64,
|
22 |
num_layers=3,
|
23 |
).to(device)
|
24 |
-
|
|
|
25 |
mask_train = data.edge_index[0] < data.edge_index[1]
|
26 |
train_edge_label_index = data.edge_index[:, mask_train]
|
27 |
lightGCNModel.load_state_dict(ch['model_state_dict'])
|
28 |
-
optimizer.load_state_dict(ch['optimizer_state_dict'])
|
29 |
num_items = 1682
|
30 |
num_users = 943
|
31 |
|
|
|
13 |
from torch_geometric.nn import LightGCN
|
14 |
import utils
|
15 |
|
16 |
+
device = torch.device('cpu')
|
17 |
data = torch.load("processed_MVL_light.pt")
|
18 |
ch = torch.load('./lightGCNModel_num_layers_MovieLens100K_checkpoint.pt')
|
19 |
lightGCNModel = LightGCN(
|
|
|
21 |
embedding_dim=64,
|
22 |
num_layers=3,
|
23 |
).to(device)
|
24 |
+
|
25 |
+
# optimizer = torch.optim.Adam(lightGCNModel.parameters(), lr=0.005)
|
26 |
mask_train = data.edge_index[0] < data.edge_index[1]
|
27 |
train_edge_label_index = data.edge_index[:, mask_train]
|
28 |
lightGCNModel.load_state_dict(ch['model_state_dict'])
|
29 |
+
# optimizer.load_state_dict(ch['optimizer_state_dict'])
|
30 |
num_items = 1682
|
31 |
num_users = 943
|
32 |
|