示例#1
0
from aim import Session

sess = Session()

sess.set_params({
    'foo': 'bar',
})

for i in range(10):
    sess.track(i, name='val')
示例#2
0
        outputs = model(images)
        loss = criterion(outputs, labels)

        # Backward and optimize
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()

        if i % 30 == 0:
            print('Epoch [{}/{}], Step [{}/{}], '
                  'Loss: {:.4f}'.format(epoch + 1, num_epochs, i + 1,
                                        total_step, loss.item()))

            # aim - Track model loss function
            aim_sess.track(loss.item(),
                           name='loss',
                           epoch=epoch,
                           subset='train')

            correct = 0
            total = 0
            _, predicted = torch.max(outputs.data, 1)
            total += labels.size(0)
            correct += (predicted == labels).sum().item()
            acc = 100 * correct / total

            # aim - Track metrics
            aim_sess.track(acc, name='accuracy', epoch=epoch, subset='train')

            # TODO: Do actual validation
            if i % 300 == 0:
                aim_sess.track(loss.item(),
示例#3
0
from aim import Session

sess1 = Session(experiment='line')
sess2 = Session(experiment='linex2')

sess1.set_params({
    'k': '1',
})
sess2.set_params({
    'k': '2',
})

for i in range(10):
    sess1.track(i, name='val')
    sess2.track(i*2, name='val')