Máquinas de Boltzmann Restringidas

Importando librerías

In [1]:
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable

Importando datasets

In [2]:
movies = pd.read_csv(
    "ml-1m/movies.dat",
    sep = '::',
    header = None,
    engine = 'python',
    encoding = 'latin-1'
)
users  = pd.read_csv(
    "ml-1m/users.dat",
    sep = '::',
    header = None,
    engine = 'python',
    encoding = 'latin-1'
)
ratings  = pd.read_csv(
    "ml-1m/ratings.dat",
    sep = '::',
    header = None,
    engine = 'python',
    encoding = 'latin-1'
)

Preparar el conjunto de entrenamiento y elconjunto de testing

In [3]:
training_set = pd.read_csv("ml-100k/u1.base", sep = "\t", header = None)
training_set = np.array(training_set, dtype = "int")
test_set = pd.read_csv("ml-100k/u1.test", sep = "\t", header = None)
test_set = np.array(test_set, dtype = "int")

Obtener el número de usuarios y de películas

In [4]:
nb_users = int(max(max(training_set[:, 0]), max(test_set[:,0])))
nb_movies = int(max(max(training_set[:, 1]), max(test_set[:, 1])))

Convertir los datos en una matriz bidimensional X[u,i].

Usuarios u en fila y películas i en columnas

In [5]:
def convert(data):
    new_data = []
    for id_user in range(1, nb_users+1):
        id_movies = data[:, 1][data[:, 0] == id_user]
        id_ratings = data[:, 2][data[:, 0] == id_user]
        ratings = np.zeros(nb_movies)
        ratings[id_movies-1] = id_ratings
        new_data.append(list(ratings))
    return new_data

training_set = convert(training_set)
test_set = convert(test_set)

Convertir los datos a tensores de Torch

In [6]:
training_set = torch.FloatTensor(training_set)
test_set = torch.FloatTensor(test_set)

Convertir las valoraciones a valores binarios

  • 1 (Me gusta)
  • 0 (No me gusta)
In [7]:
training_set[training_set == 0] = -1
training_set[training_set == 1] = 0
training_set[training_set == 2] = 0
training_set[training_set >= 3] = 1

test_set[test_set == 0] = -1
test_set[test_set == 1] = 0
test_set[test_set == 2] = 0
test_set[test_set >= 3] = 1
# test_set

Crear la arquitectura de la Red Neuronal

(Modelo Probabilistico Gráfico)

In [8]:
class RBM():
    def __init__(self, nv, nh):
        self.W = torch.randn(nh, nv)
        self.a = torch.randn(1, nh)
        self.b = torch.randn(1, nv)
    def sample_h(self, x):           #x = mini_batch_size x nv
        wx = torch.mm(x, self.W.t()) #mini_batch_size x nh
        activation = wx + self.a.expand_as(wx)
        p_h_given_v = torch.sigmoid(activation)
        return p_h_given_v, torch.bernoulli(p_h_given_v)
    def sample_v(self, y):           #y = mini_batch_size x nh
        wy = torch.mm(y, self.W) #mini_batch_size x nv
        activation = wy + self.b.expand_as(wy)
        p_v_given_h = torch.sigmoid(activation)
        return p_v_given_h, torch.bernoulli(p_v_given_h)   
    def train(self, v0, vk, ph0, phk):
        self.W += (torch.mm(v0.t(), ph0) - torch.mm(vk.t(), phk)).t()
        self.b += torch.sum((v0 - vk), 0)
        self.a += torch.sum((ph0 - phk), 0)

Entrenar la RBM

In [9]:
nv = len(training_set[0])
nh = 100
batch_size = 100
nb_epoch = 10

rbm = RBM(nv, nh)

for epoch in range(1, nb_epoch+1):
    training_loss = 0
    s = 0.
    for id_user in range(0, nb_users - batch_size, batch_size):
        vk = training_set[id_user:id_user+batch_size]
        v0 = training_set[id_user:id_user+batch_size]
        ph0,_ = rbm.sample_h(v0)
        for k in range(10):
            _,hk = rbm.sample_h(vk)
            _,vk = rbm.sample_v(hk)
            vk[v0 < 0] = v0[v0 < 0]
        phk,_ = rbm.sample_h(vk)
        rbm.train(v0, vk, ph0, phk)
        training_loss += torch.mean(torch.abs(v0[v0>=0] - vk[v0>=0]))
        s += 1.
    print("Epoch: "+str(epoch)+", Loss: "+str(training_loss/s))
Epoch: 1, Loss: tensor(0.3758)
Epoch: 2, Loss: tensor(0.2488)
Epoch: 3, Loss: tensor(0.2477)
Epoch: 4, Loss: tensor(0.2513)
Epoch: 5, Loss: tensor(0.2494)
Epoch: 6, Loss: tensor(0.2479)
Epoch: 7, Loss: tensor(0.2514)
Epoch: 8, Loss: tensor(0.2461)
Epoch: 9, Loss: tensor(0.2517)
Epoch: 10, Loss: tensor(0.2456)

Testear la RBM

In [10]:
testing_loss = 0
s = 0.
for id_user in range(nb_users):
    v = training_set[id_user:id_user+1]
    vt = test_set[id_user:id_user+1]
    if len(vt[vt>=0]) > 0:
        _,h = rbm.sample_h(v)
        _,v = rbm.sample_v(h)
        testing_loss += torch.mean(torch.abs(vt[vt>=0] - v[vt>=0]))
        s += 1.
        print(f"Usuario: {id_user+1}, Testing Loss: "+str(testing_loss/s))
Usuario: 1, Testing Loss: tensor(0.2555)
Usuario: 2, Testing Loss: tensor(0.2186)
Usuario: 3, Testing Loss: tensor(0.2740)
Usuario: 4, Testing Loss: tensor(0.2305)
Usuario: 5, Testing Loss: tensor(0.2677)
Usuario: 6, Testing Loss: tensor(0.2544)
Usuario: 7, Testing Loss: tensor(0.2467)
Usuario: 8, Testing Loss: tensor(0.2331)
Usuario: 9, Testing Loss: tensor(0.2183)
Usuario: 10, Testing Loss: tensor(0.2109)
Usuario: 11, Testing Loss: tensor(0.2145)
Usuario: 12, Testing Loss: tensor(0.1966)
Usuario: 13, Testing Loss: tensor(0.2060)
Usuario: 14, Testing Loss: tensor(0.2026)
Usuario: 15, Testing Loss: tensor(0.2270)
Usuario: 16, Testing Loss: tensor(0.2216)
Usuario: 17, Testing Loss: tensor(0.2282)
Usuario: 18, Testing Loss: tensor(0.2197)
Usuario: 19, Testing Loss: tensor(0.2134)
Usuario: 20, Testing Loss: tensor(0.2255)
Usuario: 21, Testing Loss: tensor(0.2295)
Usuario: 22, Testing Loss: tensor(0.2316)
Usuario: 23, Testing Loss: tensor(0.2284)
Usuario: 24, Testing Loss: tensor(0.2266)
Usuario: 25, Testing Loss: tensor(0.2208)
Usuario: 26, Testing Loss: tensor(0.2254)
Usuario: 27, Testing Loss: tensor(0.2294)
Usuario: 28, Testing Loss: tensor(0.2266)
Usuario: 29, Testing Loss: tensor(0.2269)
Usuario: 30, Testing Loss: tensor(0.2323)
Usuario: 31, Testing Loss: tensor(0.2397)
Usuario: 32, Testing Loss: tensor(0.2421)
Usuario: 33, Testing Loss: tensor(0.2438)
Usuario: 34, Testing Loss: tensor(0.2455)
Usuario: 35, Testing Loss: tensor(0.2599)
Usuario: 36, Testing Loss: tensor(0.2628)
Usuario: 37, Testing Loss: tensor(0.2597)
Usuario: 38, Testing Loss: tensor(0.2620)
Usuario: 39, Testing Loss: tensor(0.2552)
Usuario: 40, Testing Loss: tensor(0.2546)
Usuario: 41, Testing Loss: tensor(0.2519)
Usuario: 42, Testing Loss: tensor(0.2499)
Usuario: 43, Testing Loss: tensor(0.2486)
Usuario: 44, Testing Loss: tensor(0.2481)
Usuario: 45, Testing Loss: tensor(0.2496)
Usuario: 46, Testing Loss: tensor(0.2482)
Usuario: 47, Testing Loss: tensor(0.2500)
Usuario: 48, Testing Loss: tensor(0.2467)
Usuario: 49, Testing Loss: tensor(0.2513)
Usuario: 50, Testing Loss: tensor(0.2536)
Usuario: 51, Testing Loss: tensor(0.2514)
Usuario: 52, Testing Loss: tensor(0.2511)
Usuario: 53, Testing Loss: tensor(0.2495)
Usuario: 54, Testing Loss: tensor(0.2492)
Usuario: 55, Testing Loss: tensor(0.2496)
Usuario: 56, Testing Loss: tensor(0.2493)
Usuario: 57, Testing Loss: tensor(0.2493)
Usuario: 58, Testing Loss: tensor(0.2485)
Usuario: 59, Testing Loss: tensor(0.2489)
Usuario: 60, Testing Loss: tensor(0.2459)
Usuario: 61, Testing Loss: tensor(0.2492)
Usuario: 62, Testing Loss: tensor(0.2491)
Usuario: 63, Testing Loss: tensor(0.2501)
Usuario: 64, Testing Loss: tensor(0.2500)
Usuario: 65, Testing Loss: tensor(0.2485)
Usuario: 66, Testing Loss: tensor(0.2475)
Usuario: 67, Testing Loss: tensor(0.2462)
Usuario: 68, Testing Loss: tensor(0.2445)
Usuario: 69, Testing Loss: tensor(0.2420)
Usuario: 70, Testing Loss: tensor(0.2412)
Usuario: 71, Testing Loss: tensor(0.2395)
Usuario: 72, Testing Loss: tensor(0.2380)
Usuario: 73, Testing Loss: tensor(0.2360)
Usuario: 74, Testing Loss: tensor(0.2335)
Usuario: 75, Testing Loss: tensor(0.2354)
Usuario: 76, Testing Loss: tensor(0.2351)
Usuario: 77, Testing Loss: tensor(0.2336)
Usuario: 78, Testing Loss: tensor(0.2325)
Usuario: 79, Testing Loss: tensor(0.2345)
Usuario: 80, Testing Loss: tensor(0.2333)
Usuario: 81, Testing Loss: tensor(0.2357)
Usuario: 82, Testing Loss: tensor(0.2362)
Usuario: 83, Testing Loss: tensor(0.2377)
Usuario: 84, Testing Loss: tensor(0.2354)
Usuario: 85, Testing Loss: tensor(0.2348)
Usuario: 86, Testing Loss: tensor(0.2360)
Usuario: 87, Testing Loss: tensor(0.2361)
Usuario: 88, Testing Loss: tensor(0.2368)
Usuario: 89, Testing Loss: tensor(0.2372)
Usuario: 90, Testing Loss: tensor(0.2364)
Usuario: 91, Testing Loss: tensor(0.2366)
Usuario: 92, Testing Loss: tensor(0.2366)
Usuario: 93, Testing Loss: tensor(0.2380)
Usuario: 94, Testing Loss: tensor(0.2382)
Usuario: 95, Testing Loss: tensor(0.2381)
Usuario: 96, Testing Loss: tensor(0.2368)
Usuario: 97, Testing Loss: tensor(0.2354)
Usuario: 98, Testing Loss: tensor(0.2377)
Usuario: 99, Testing Loss: tensor(0.2380)
Usuario: 100, Testing Loss: tensor(0.2385)
Usuario: 101, Testing Loss: tensor(0.2409)
Usuario: 102, Testing Loss: tensor(0.2419)
Usuario: 103, Testing Loss: tensor(0.2410)
Usuario: 104, Testing Loss: tensor(0.2428)
Usuario: 105, Testing Loss: tensor(0.2419)
Usuario: 106, Testing Loss: tensor(0.2407)
Usuario: 107, Testing Loss: tensor(0.2415)
Usuario: 108, Testing Loss: tensor(0.2410)
Usuario: 109, Testing Loss: tensor(0.2412)
Usuario: 110, Testing Loss: tensor(0.2417)
Usuario: 111, Testing Loss: tensor(0.2418)
Usuario: 112, Testing Loss: tensor(0.2424)
Usuario: 113, Testing Loss: tensor(0.2438)
Usuario: 114, Testing Loss: tensor(0.2425)
Usuario: 115, Testing Loss: tensor(0.2424)
Usuario: 116, Testing Loss: tensor(0.2436)
Usuario: 117, Testing Loss: tensor(0.2433)
Usuario: 118, Testing Loss: tensor(0.2427)
Usuario: 119, Testing Loss: tensor(0.2424)
Usuario: 120, Testing Loss: tensor(0.2425)
Usuario: 121, Testing Loss: tensor(0.2432)
Usuario: 122, Testing Loss: tensor(0.2430)
Usuario: 123, Testing Loss: tensor(0.2417)
Usuario: 124, Testing Loss: tensor(0.2413)
Usuario: 125, Testing Loss: tensor(0.2415)
Usuario: 126, Testing Loss: tensor(0.2428)
Usuario: 127, Testing Loss: tensor(0.2435)
Usuario: 128, Testing Loss: tensor(0.2430)
Usuario: 129, Testing Loss: tensor(0.2452)
Usuario: 130, Testing Loss: tensor(0.2451)
Usuario: 131, Testing Loss: tensor(0.2448)
Usuario: 132, Testing Loss: tensor(0.2429)
Usuario: 133, Testing Loss: tensor(0.2439)
Usuario: 134, Testing Loss: tensor(0.2444)
Usuario: 135, Testing Loss: tensor(0.2439)
Usuario: 136, Testing Loss: tensor(0.2430)
Usuario: 137, Testing Loss: tensor(0.2422)
Usuario: 138, Testing Loss: tensor(0.2414)
Usuario: 139, Testing Loss: tensor(0.2404)
Usuario: 140, Testing Loss: tensor(0.2407)
Usuario: 141, Testing Loss: tensor(0.2417)
Usuario: 142, Testing Loss: tensor(0.2421)
Usuario: 143, Testing Loss: tensor(0.2404)
Usuario: 144, Testing Loss: tensor(0.2403)
Usuario: 145, Testing Loss: tensor(0.2410)
Usuario: 146, Testing Loss: tensor(0.2407)
Usuario: 147, Testing Loss: tensor(0.2391)
Usuario: 148, Testing Loss: tensor(0.2390)
Usuario: 149, Testing Loss: tensor(0.2410)
Usuario: 150, Testing Loss: tensor(0.2409)
Usuario: 151, Testing Loss: tensor(0.2408)
Usuario: 152, Testing Loss: tensor(0.2408)
Usuario: 153, Testing Loss: tensor(0.2432)
Usuario: 154, Testing Loss: tensor(0.2422)
Usuario: 155, Testing Loss: tensor(0.2447)
Usuario: 156, Testing Loss: tensor(0.2435)
Usuario: 157, Testing Loss: tensor(0.2438)
Usuario: 158, Testing Loss: tensor(0.2433)
Usuario: 159, Testing Loss: tensor(0.2439)
Usuario: 160, Testing Loss: tensor(0.2437)
Usuario: 161, Testing Loss: tensor(0.2453)
Usuario: 162, Testing Loss: tensor(0.2447)
Usuario: 163, Testing Loss: tensor(0.2432)
Usuario: 164, Testing Loss: tensor(0.2431)
Usuario: 165, Testing Loss: tensor(0.2426)
Usuario: 166, Testing Loss: tensor(0.2436)
Usuario: 167, Testing Loss: tensor(0.2446)
Usuario: 168, Testing Loss: tensor(0.2451)
Usuario: 169, Testing Loss: tensor(0.2449)
Usuario: 170, Testing Loss: tensor(0.2443)
Usuario: 171, Testing Loss: tensor(0.2435)
Usuario: 172, Testing Loss: tensor(0.2441)
Usuario: 173, Testing Loss: tensor(0.2430)
Usuario: 174, Testing Loss: tensor(0.2436)
Usuario: 175, Testing Loss: tensor(0.2426)
Usuario: 176, Testing Loss: tensor(0.2418)
Usuario: 177, Testing Loss: tensor(0.2418)
Usuario: 178, Testing Loss: tensor(0.2416)
Usuario: 179, Testing Loss: tensor(0.2426)
Usuario: 180, Testing Loss: tensor(0.2418)
Usuario: 181, Testing Loss: tensor(0.2439)
Usuario: 182, Testing Loss: tensor(0.2433)
Usuario: 183, Testing Loss: tensor(0.2437)
Usuario: 184, Testing Loss: tensor(0.2433)
Usuario: 185, Testing Loss: tensor(0.2425)
Usuario: 186, Testing Loss: tensor(0.2430)
Usuario: 187, Testing Loss: tensor(0.2420)
Usuario: 188, Testing Loss: tensor(0.2416)
Usuario: 189, Testing Loss: tensor(0.2412)
Usuario: 190, Testing Loss: tensor(0.2417)
Usuario: 191, Testing Loss: tensor(0.2417)
Usuario: 192, Testing Loss: tensor(0.2415)
Usuario: 193, Testing Loss: tensor(0.2424)
Usuario: 194, Testing Loss: tensor(0.2426)
Usuario: 195, Testing Loss: tensor(0.2427)
Usuario: 196, Testing Loss: tensor(0.2426)
Usuario: 197, Testing Loss: tensor(0.2426)
Usuario: 198, Testing Loss: tensor(0.2422)
Usuario: 199, Testing Loss: tensor(0.2427)
Usuario: 200, Testing Loss: tensor(0.2422)
Usuario: 201, Testing Loss: tensor(0.2427)
Usuario: 202, Testing Loss: tensor(0.2436)
Usuario: 203, Testing Loss: tensor(0.2438)
Usuario: 204, Testing Loss: tensor(0.2448)
Usuario: 205, Testing Loss: tensor(0.2448)
Usuario: 206, Testing Loss: tensor(0.2464)
Usuario: 207, Testing Loss: tensor(0.2464)
Usuario: 208, Testing Loss: tensor(0.2461)
Usuario: 209, Testing Loss: tensor(0.2469)
Usuario: 210, Testing Loss: tensor(0.2464)
Usuario: 211, Testing Loss: tensor(0.2464)
Usuario: 212, Testing Loss: tensor(0.2464)
Usuario: 213, Testing Loss: tensor(0.2461)
Usuario: 214, Testing Loss: tensor(0.2456)
Usuario: 215, Testing Loss: tensor(0.2451)
Usuario: 216, Testing Loss: tensor(0.2450)
Usuario: 217, Testing Loss: tensor(0.2455)
Usuario: 218, Testing Loss: tensor(0.2457)
Usuario: 219, Testing Loss: tensor(0.2457)
Usuario: 220, Testing Loss: tensor(0.2454)
Usuario: 221, Testing Loss: tensor(0.2455)
Usuario: 222, Testing Loss: tensor(0.2458)
Usuario: 223, Testing Loss: tensor(0.2463)
Usuario: 224, Testing Loss: tensor(0.2466)
Usuario: 225, Testing Loss: tensor(0.2466)
Usuario: 226, Testing Loss: tensor(0.2460)
Usuario: 227, Testing Loss: tensor(0.2455)
Usuario: 228, Testing Loss: tensor(0.2457)
Usuario: 229, Testing Loss: tensor(0.2475)
Usuario: 230, Testing Loss: tensor(0.2474)
Usuario: 231, Testing Loss: tensor(0.2475)
Usuario: 232, Testing Loss: tensor(0.2470)
Usuario: 233, Testing Loss: tensor(0.2461)
Usuario: 234, Testing Loss: tensor(0.2462)
Usuario: 235, Testing Loss: tensor(0.2456)
Usuario: 236, Testing Loss: tensor(0.2457)
Usuario: 237, Testing Loss: tensor(0.2449)
Usuario: 238, Testing Loss: tensor(0.2455)
Usuario: 239, Testing Loss: tensor(0.2451)
Usuario: 240, Testing Loss: tensor(0.2446)
Usuario: 241, Testing Loss: tensor(0.2447)
Usuario: 242, Testing Loss: tensor(0.2446)
Usuario: 243, Testing Loss: tensor(0.2443)
Usuario: 244, Testing Loss: tensor(0.2445)
Usuario: 245, Testing Loss: tensor(0.2453)
Usuario: 246, Testing Loss: tensor(0.2457)
Usuario: 247, Testing Loss: tensor(0.2454)
Usuario: 248, Testing Loss: tensor(0.2450)
Usuario: 249, Testing Loss: tensor(0.2447)
Usuario: 250, Testing Loss: tensor(0.2449)
Usuario: 251, Testing Loss: tensor(0.2444)
Usuario: 252, Testing Loss: tensor(0.2438)
Usuario: 253, Testing Loss: tensor(0.2433)
Usuario: 254, Testing Loss: tensor(0.2435)
Usuario: 255, Testing Loss: tensor(0.2440)
Usuario: 256, Testing Loss: tensor(0.2439)
Usuario: 257, Testing Loss: tensor(0.2432)
Usuario: 258, Testing Loss: tensor(0.2438)
Usuario: 259, Testing Loss: tensor(0.2439)
Usuario: 260, Testing Loss: tensor(0.2446)
Usuario: 261, Testing Loss: tensor(0.2443)
Usuario: 262, Testing Loss: tensor(0.2450)
Usuario: 263, Testing Loss: tensor(0.2447)
Usuario: 264, Testing Loss: tensor(0.2447)
Usuario: 265, Testing Loss: tensor(0.2452)
Usuario: 266, Testing Loss: tensor(0.2453)
Usuario: 267, Testing Loss: tensor(0.2448)
Usuario: 268, Testing Loss: tensor(0.2452)
Usuario: 269, Testing Loss: tensor(0.2453)
Usuario: 270, Testing Loss: tensor(0.2454)
Usuario: 271, Testing Loss: tensor(0.2452)
Usuario: 272, Testing Loss: tensor(0.2448)
Usuario: 273, Testing Loss: tensor(0.2447)
Usuario: 274, Testing Loss: tensor(0.2444)
Usuario: 275, Testing Loss: tensor(0.2439)
Usuario: 276, Testing Loss: tensor(0.2439)
Usuario: 277, Testing Loss: tensor(0.2436)
Usuario: 278, Testing Loss: tensor(0.2427)
Usuario: 279, Testing Loss: tensor(0.2430)
Usuario: 280, Testing Loss: tensor(0.2431)
Usuario: 281, Testing Loss: tensor(0.2446)
Usuario: 282, Testing Loss: tensor(0.2447)
Usuario: 283, Testing Loss: tensor(0.2451)
Usuario: 284, Testing Loss: tensor(0.2449)
Usuario: 285, Testing Loss: tensor(0.2443)
Usuario: 286, Testing Loss: tensor(0.2443)
Usuario: 287, Testing Loss: tensor(0.2442)
Usuario: 288, Testing Loss: tensor(0.2438)
Usuario: 289, Testing Loss: tensor(0.2449)
Usuario: 290, Testing Loss: tensor(0.2451)
Usuario: 291, Testing Loss: tensor(0.2454)
Usuario: 292, Testing Loss: tensor(0.2448)
Usuario: 293, Testing Loss: tensor(0.2451)
Usuario: 294, Testing Loss: tensor(0.2450)
Usuario: 295, Testing Loss: tensor(0.2450)
Usuario: 296, Testing Loss: tensor(0.2450)
Usuario: 297, Testing Loss: tensor(0.2449)
Usuario: 298, Testing Loss: tensor(0.2445)
Usuario: 299, Testing Loss: tensor(0.2444)
Usuario: 300, Testing Loss: tensor(0.2444)
Usuario: 301, Testing Loss: tensor(0.2444)
Usuario: 302, Testing Loss: tensor(0.2457)
Usuario: 303, Testing Loss: tensor(0.2461)
Usuario: 304, Testing Loss: tensor(0.2465)
Usuario: 305, Testing Loss: tensor(0.2467)
Usuario: 306, Testing Loss: tensor(0.2469)
Usuario: 307, Testing Loss: tensor(0.2464)
Usuario: 308, Testing Loss: tensor(0.2461)
Usuario: 309, Testing Loss: tensor(0.2467)
Usuario: 310, Testing Loss: tensor(0.2473)
Usuario: 311, Testing Loss: tensor(0.2470)
Usuario: 312, Testing Loss: tensor(0.2466)
Usuario: 313, Testing Loss: tensor(0.2466)
Usuario: 314, Testing Loss: tensor(0.2471)
Usuario: 315, Testing Loss: tensor(0.2467)
Usuario: 316, Testing Loss: tensor(0.2465)
Usuario: 317, Testing Loss: tensor(0.2463)
Usuario: 318, Testing Loss: tensor(0.2465)
Usuario: 319, Testing Loss: tensor(0.2462)
Usuario: 320, Testing Loss: tensor(0.2463)
Usuario: 321, Testing Loss: tensor(0.2460)
Usuario: 322, Testing Loss: tensor(0.2453)
Usuario: 323, Testing Loss: tensor(0.2452)
Usuario: 324, Testing Loss: tensor(0.2451)
Usuario: 325, Testing Loss: tensor(0.2451)
Usuario: 326, Testing Loss: tensor(0.2450)
Usuario: 327, Testing Loss: tensor(0.2449)
Usuario: 328, Testing Loss: tensor(0.2449)
Usuario: 329, Testing Loss: tensor(0.2445)
Usuario: 330, Testing Loss: tensor(0.2442)
Usuario: 331, Testing Loss: tensor(0.2442)
Usuario: 332, Testing Loss: tensor(0.2440)
Usuario: 333, Testing Loss: tensor(0.2441)
Usuario: 334, Testing Loss: tensor(0.2439)
Usuario: 335, Testing Loss: tensor(0.2435)
Usuario: 336, Testing Loss: tensor(0.2439)
Usuario: 337, Testing Loss: tensor(0.2438)
Usuario: 338, Testing Loss: tensor(0.2434)
Usuario: 339, Testing Loss: tensor(0.2430)
Usuario: 340, Testing Loss: tensor(0.2425)
Usuario: 341, Testing Loss: tensor(0.2424)
Usuario: 342, Testing Loss: tensor(0.2425)
Usuario: 343, Testing Loss: tensor(0.2424)
Usuario: 344, Testing Loss: tensor(0.2422)
Usuario: 345, Testing Loss: tensor(0.2421)
Usuario: 346, Testing Loss: tensor(0.2423)
Usuario: 347, Testing Loss: tensor(0.2425)
Usuario: 348, Testing Loss: tensor(0.2428)
Usuario: 349, Testing Loss: tensor(0.2436)
Usuario: 350, Testing Loss: tensor(0.2433)
Usuario: 351, Testing Loss: tensor(0.2436)
Usuario: 352, Testing Loss: tensor(0.2434)
Usuario: 353, Testing Loss: tensor(0.2434)
Usuario: 354, Testing Loss: tensor(0.2432)
Usuario: 355, Testing Loss: tensor(0.2426)
Usuario: 356, Testing Loss: tensor(0.2425)
Usuario: 357, Testing Loss: tensor(0.2429)
Usuario: 358, Testing Loss: tensor(0.2429)
Usuario: 359, Testing Loss: tensor(0.2431)
Usuario: 360, Testing Loss: tensor(0.2430)
Usuario: 361, Testing Loss: tensor(0.2429)
Usuario: 362, Testing Loss: tensor(0.2434)
Usuario: 363, Testing Loss: tensor(0.2435)
Usuario: 364, Testing Loss: tensor(0.2428)
Usuario: 365, Testing Loss: tensor(0.2433)
Usuario: 366, Testing Loss: tensor(0.2431)
Usuario: 367, Testing Loss: tensor(0.2429)
Usuario: 368, Testing Loss: tensor(0.2433)
Usuario: 369, Testing Loss: tensor(0.2432)
Usuario: 370, Testing Loss: tensor(0.2431)
Usuario: 371, Testing Loss: tensor(0.2429)
Usuario: 372, Testing Loss: tensor(0.2431)
Usuario: 373, Testing Loss: tensor(0.2429)
Usuario: 374, Testing Loss: tensor(0.2432)
Usuario: 375, Testing Loss: tensor(0.2434)
Usuario: 376, Testing Loss: tensor(0.2434)
Usuario: 377, Testing Loss: tensor(0.2434)
Usuario: 378, Testing Loss: tensor(0.2435)
Usuario: 379, Testing Loss: tensor(0.2434)
Usuario: 380, Testing Loss: tensor(0.2431)
Usuario: 381, Testing Loss: tensor(0.2432)
Usuario: 382, Testing Loss: tensor(0.2435)
Usuario: 383, Testing Loss: tensor(0.2435)
Usuario: 384, Testing Loss: tensor(0.2429)
Usuario: 385, Testing Loss: tensor(0.2432)
Usuario: 386, Testing Loss: tensor(0.2431)
Usuario: 387, Testing Loss: tensor(0.2430)
Usuario: 388, Testing Loss: tensor(0.2426)
Usuario: 389, Testing Loss: tensor(0.2425)
Usuario: 390, Testing Loss: tensor(0.2428)
Usuario: 391, Testing Loss: tensor(0.2427)
Usuario: 392, Testing Loss: tensor(0.2427)
Usuario: 393, Testing Loss: tensor(0.2429)
Usuario: 394, Testing Loss: tensor(0.2431)
Usuario: 395, Testing Loss: tensor(0.2432)
Usuario: 396, Testing Loss: tensor(0.2436)
Usuario: 397, Testing Loss: tensor(0.2438)
Usuario: 398, Testing Loss: tensor(0.2433)
Usuario: 399, Testing Loss: tensor(0.2434)
Usuario: 400, Testing Loss: tensor(0.2433)
Usuario: 401, Testing Loss: tensor(0.2433)
Usuario: 402, Testing Loss: tensor(0.2430)
Usuario: 403, Testing Loss: tensor(0.2424)
Usuario: 404, Testing Loss: tensor(0.2427)
Usuario: 405, Testing Loss: tensor(0.2433)
Usuario: 406, Testing Loss: tensor(0.2432)
Usuario: 407, Testing Loss: tensor(0.2430)
Usuario: 408, Testing Loss: tensor(0.2430)
Usuario: 409, Testing Loss: tensor(0.2432)
Usuario: 410, Testing Loss: tensor(0.2431)
Usuario: 411, Testing Loss: tensor(0.2428)
Usuario: 412, Testing Loss: tensor(0.2424)
Usuario: 413, Testing Loss: tensor(0.2425)
Usuario: 414, Testing Loss: tensor(0.2435)
Usuario: 415, Testing Loss: tensor(0.2438)
Usuario: 416, Testing Loss: tensor(0.2438)
Usuario: 417, Testing Loss: tensor(0.2440)
Usuario: 418, Testing Loss: tensor(0.2444)
Usuario: 419, Testing Loss: tensor(0.2438)
Usuario: 420, Testing Loss: tensor(0.2432)
Usuario: 421, Testing Loss: tensor(0.2430)
Usuario: 422, Testing Loss: tensor(0.2428)
Usuario: 423, Testing Loss: tensor(0.2422)
Usuario: 424, Testing Loss: tensor(0.2423)
Usuario: 425, Testing Loss: tensor(0.2426)
Usuario: 426, Testing Loss: tensor(0.2422)
Usuario: 427, Testing Loss: tensor(0.2420)
Usuario: 428, Testing Loss: tensor(0.2421)
Usuario: 429, Testing Loss: tensor(0.2419)
Usuario: 430, Testing Loss: tensor(0.2413)
Usuario: 431, Testing Loss: tensor(0.2408)
Usuario: 432, Testing Loss: tensor(0.2411)
Usuario: 433, Testing Loss: tensor(0.2411)
Usuario: 434, Testing Loss: tensor(0.2421)
Usuario: 435, Testing Loss: tensor(0.2420)
Usuario: 436, Testing Loss: tensor(0.2419)
Usuario: 437, Testing Loss: tensor(0.2418)
Usuario: 438, Testing Loss: tensor(0.2424)
Usuario: 439, Testing Loss: tensor(0.2426)
Usuario: 440, Testing Loss: tensor(0.2421)
Usuario: 442, Testing Loss: tensor(0.2424)
Usuario: 444, Testing Loss: tensor(0.2426)
Usuario: 445, Testing Loss: tensor(0.2434)
Usuario: 446, Testing Loss: tensor(0.2451)
Usuario: 447, Testing Loss: tensor(0.2450)
Usuario: 448, Testing Loss: tensor(0.2466)
Usuario: 449, Testing Loss: tensor(0.2467)
Usuario: 450, Testing Loss: tensor(0.2463)
Usuario: 451, Testing Loss: tensor(0.2471)
Usuario: 452, Testing Loss: tensor(0.2474)
Usuario: 453, Testing Loss: tensor(0.2472)
Usuario: 454, Testing Loss: tensor(0.2474)
Usuario: 455, Testing Loss: tensor(0.2469)
Usuario: 456, Testing Loss: tensor(0.2474)
Usuario: 457, Testing Loss: tensor(0.2472)
Usuario: 458, Testing Loss: tensor(0.2474)
Usuario: 459, Testing Loss: tensor(0.2490)
Usuario: 460, Testing Loss: tensor(0.2485)
Usuario: 462, Testing Loss: tensor(0.2479)