Plotting with Torch7

plplot

plPlot is cross-platform software package suitable for creating scientific plots. It is very close to gnuplot in several ways. DeepMind implements a wrapper. Yet I have not tested it

Other libraries

Those libraries existed before Torch7. Therefore, they do not use torch.Tensor. They do work well, I tested them

3 Comments on “Plotting with Torch7

  1. Great,
    I would like to ask if there is a way how to compute Recall and precision from a confusion matrix and draw them if it is possible. I am facing this problem for more than a month but I could not find an answer. So, please help.

    • Sure!
      First, you can compute your confusion matrix my using the optim package: https://github.com/torch/optim/blob/master/ConfusionMatrix.lua

      Then, if you want to plot accuracy/recall upon time, Dygraph/Display is a good library

      For every steps:
      – Compute the Precision/Recall from your confusion matrix
      \text{Precision}=\frac{tp}{tp+fp} \,
      \text{Recall}=\frac{tp}{tp+fn} \,

      – Plot it !

      Lua code:

      local labels = {"epoch", 'accuracy', 'recall'}
      local data = {}

      local config =
      {
      title = "Global accuracy/recall upon time",
      labels = labels,
      ylabel = "ratio",
      }

      for t = 1, noEpoch do

      --computation
      local accuracy, recall = someFct()

      --storage
      table.insert(data, {t, accuracy, recall })

      -- display
      config.win = disp.plot(data, config)

      end

      • Hi
        Many thanks for replying but I try it many times but did not work with. Could you please give me more intuition about the code.
        Regards,

Leave a Reply

Your email address will not be published.