visualization v 1.0.0.000, titanlearn v 2.0.1.001

This commit is contained in:
art 2019-11-01 13:08:32 -05:00
parent 8dd2440f08
commit 1d4b2bd49d
2 changed files with 39 additions and 9 deletions

View File

@ -7,10 +7,13 @@
# this module learns from its mistakes far faster than 2022's captains
# setup:
__version__ = "2.0.1.000"
__version__ = "2.0.1.001"
#changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
2.0.1.001:
- removed matplotlib import
- removed graphloss()
2.0.1.000:
- added net, dataset, dataloader, and stdtrain template definitions
- added graphloss function
@ -36,7 +39,6 @@ __all__ = [
import torch
from os import system, name
import matplotlib.pyplot as plt
import numpy as np
def clear():
@ -113,10 +115,4 @@ def stdtrainer(net, criterion, optimizer, dataloader, epochs, batch_size):
optimizer = optimizer.to(device)
trainloader = dataloader
return train(device, net, epochs, trainloader, optimizer, criterion)
def graphloss(losses):
x = range(0, len(losses))
plt.plot(x, losses)
plt.show()
return train(device, net, epochs, trainloader, optimizer, criterion)

View File

@ -0,0 +1,34 @@
# Titan Robotics Team 2022: Visualization Module
# Written by Arthur Lu & Jacob Levine
# Notes:
# this should be imported as a python module using 'import visualization'
# this should be included in the local directory or environment variable
# fancy
# setup:
__version__ = "1.0.0.000"
#changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
1.0.0.000:
- created visualization.py
- added graphloss()
- added imports
"""
__author__ = (
"Arthur Lu <arthurlu@ttic.edu>,"
"Jacob Levine <jlevine@ttic.edu>,"
)
__all__ = [
'graphloss',
]
import matplotlib.pyplot as plt
def graphloss(losses):
x = range(0, len(losses))
plt.plot(x, losses)
plt.show()