From a87216b97186e38d25142ecd4681d1d22bad4dde Mon Sep 17 00:00:00 2001 From: art Date: Fri, 1 Nov 2019 13:08:32 -0500 Subject: [PATCH] visualization v 1.0.0.000, titanlearn v 2.0.1.001 --- data analysis/analysis/titanlearn.py | 14 ++++------ data analysis/analysis/visualization.py | 34 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 data analysis/analysis/visualization.py diff --git a/data analysis/analysis/titanlearn.py b/data analysis/analysis/titanlearn.py index 1ab327fa..b20bc5d6 100644 --- a/data analysis/analysis/titanlearn.py +++ b/data analysis/analysis/titanlearn.py @@ -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() \ No newline at end of file + return train(device, net, epochs, trainloader, optimizer, criterion) \ No newline at end of file diff --git a/data analysis/analysis/visualization.py b/data analysis/analysis/visualization.py new file mode 100644 index 00000000..a0bbfc4e --- /dev/null +++ b/data analysis/analysis/visualization.py @@ -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 ," + "Jacob Levine ," + ) + +__all__ = [ + 'graphloss', + ] + +import matplotlib.pyplot as plt + +def graphloss(losses): + + x = range(0, len(losses)) + plt.plot(x, losses) + plt.show() \ No newline at end of file