Git Product home page Git Product logo

Comments (3)

SSARCandy avatar SSARCandy commented on August 22, 2024

I store the statistic to .pkl file,
you can use pickle and matplotlib to plot the graph

for example:

import pickle
import matplotlib.pyplot as plt

with open('training_statistic.pkl', 'rb') as data:
  training = pickle.load(data)
  ...

from deepcoral.

redhat12345 avatar redhat12345 commented on August 22, 2024

Thank you so much. Can you provide full script please?

from deepcoral.

SSARCandy avatar SSARCandy commented on August 22, 2024

As you wish, but my script are not pretty at all...

import pickle
import matplotlib.pyplot as plt

training = []
testing_s = []
testing_t = []
testing_so = []
testing_to = []


with open('w-coral-256/training_statistic.pkl', 'rb') as data:
  training = pickle.load(data)

with open('w-coral-256/testing_s_statistic.pkl', 'rb') as data:
  testing_s = pickle.load(data)

with open('w-coral-256/testing_t_statistic.pkl', 'rb') as data:
  testing_t = pickle.load(data)

with open('wo-coral-256/testing_s_statistic.pkl', 'rb') as data:
  testing_so = pickle.load(data)

with open('wo-coral-256/testing_t_statistic.pkl', 'rb') as data:
  testing_to = pickle.load(data)

summary = {}
summary['training_acc'] = [ep['accuracy'] for ep in testing_s]
summary['testing_acc'] = [ep['accuracy'] for ep in testing_t]
summary['training_acco'] = [ep['accuracy'] for ep in testing_so]
summary['testing_acco'] = [ep['accuracy'] for ep in testing_to]

plt.figure(figsize=(8,5))
plt.plot(summary['testing_acc'], 'b', marker='*', fillstyle='none', label='testing acc. w/ coral loss')
plt.plot(summary['testing_acco'], 'g', marker='o', fillstyle='none', label='testing acc. w/o coral loss')
plt.plot(summary['training_acc'], 'r', marker='|', fillstyle='none', label='training acc. w/ coral loss')
plt.plot(summary['training_acco'], 'pink', marker='s', fillstyle='none', label='training acc. w/o coral loss')

plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.title('Testing Accuracy (Batch = [200, 56])')
plt.legend()
plt.savefig('accuracy.png')
# plt.show()


print(len(training[0]))
loss = {}
loss['coral_loss'] = [x['coral_loss'] for ep in training for x in ep]
loss['classification_loss'] = [x['classification_loss'] for ep in training for x in ep]
plt.figure(figsize=(6.84,5.44))
plt.plot(loss['coral_loss'], 'b', label='CORAL loss')
plt.plot(loss['classification_loss'], 'r', label='classification loss')
plt.title('Loss')
plt.legend()
plt.xlabel('iterations')
plt.ylabel('loss')
plt.savefig('loss.png')
# plt.show()

from deepcoral.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.