Functions | Variables
visualisationForPaperMasterPlot Namespace Reference

Functions

def vis_square (data, outfile, title, padsize=1, padval=0)
 
def vis_square_kernel (data, outfile, title, padsize=1, padval=0)
 
def vis_square_kernel_zoom (data, outfile, title, xminval, xmaxval, yminval, ymaxval, padsize=1, padval=0)
 

Variables

 parser = argparse.ArgumentParser()
 
 type
 
 str
 
 required
 
 int
 
 args = parser.parse_args()
 
int count = 0
 
int correct = 0
 
 matrix = defaultdict(int)
 
 labels_set = set()
 
 net = caffe.Net(args.proto, args.model, caffe.TEST)
 
 db = leveldb.LevelDB(args.leveldb)
 
 datum = caffe.proto.caffe_pb2.Datum()
 
 label = int(datum.label)
 
 image = caffe.io.datum_to_array(datum)
 
 out = net.forward_all(data=np.asarray([image]))
 
 plabel = int(out['prob'][0].argmax(axis=0))
 
 data = np.asarray([image])
 
 dataswap = np.swapaxes(data.reshape(np.delete(data.shape,0)),0,2)
 
 x = x.swapaxes(0,1)
 
 y = y.swapaxes(0,1)
 
 fig
 
 ax
 
 figsize
 
 cmap
 
 interpolation
 
 extent
 
 dpi
 
 filters1 = net.params['conv1/7x7_s2_y'][0].data
 
 filters2 = net.params['conv1/7x7_s2_x'][0].data
 
 iiiax = net.blobs['inception_3a/output_x'].data
 
 padval
 
 iiiay = net.blobs['inception_3a/output_y'].data
 
 pidSignal = float(out['prob'][0][1])
 
 pidBackground = float(out['prob'][0][0])
 
 iscorrect = plabel
 

Function Documentation

def visualisationForPaperMasterPlot.vis_square (   data,
  outfile,
  title,
  padsize = 1,
  padval = 0 
)

Definition at line 12 of file visualisationForPaperMasterPlot.py.

References int, PandAna.Demos.demo1.range, and transpose().

12 def vis_square(data, outfile, title, padsize=1, padval=0):
13  data -= data.min()
14  data /= data.max()
15 
16  # force the number of filters to be square
17  n = int(np.ceil(np.sqrt(data.shape[0])))
18  padding = ((0, n ** 2 - data.shape[0]), (0, padsize), (0, padsize)) + ((0, 0),) * (data.ndim - 3)
19  data = np.pad(data, padding, mode='constant', constant_values=(padval, padval))
20 
21  # tile the filters into an image
22  data = data.reshape((n, n) + data.shape[1:]).transpose((0, 2, 1, 3) + tuple(range(4, data.ndim + 1)))
23  data = data.reshape((n * data.shape[1], n * data.shape[3]) + data.shape[4:])
24  #print type(data)
25  #data=data.squeeze()
26 
27  #print data.shape
28  #print type(data[1][1])
29  #data.astype(np.float64)
30 
31  #plt.axis('off')
32  fig, ax = plt.subplots(figsize=(6,5))
33  #ax.set_title(title)
34  ax.set_frame_on(False)
35  ax.set_xlabel('')
36  ax.set_ylabel('')
37  ax.set_xticklabels([])
38  ax.set_yticklabels([])
39  ax.set_xticks([])
40  ax.set_yticks([])
41  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
42  xmin, xmax = ax.get_xaxis().get_view_interval()
43  ymin, ymax = ax.get_yaxis().get_view_interval()
44  ax.add_artist(Line2D((xmin, xmax-0.5), (ymin, ymin), color='black', linewidth=1.75))
45  print xmin
46  print xmax
47  print ymin
48  print ymax
49  ax.add_artist(Line2D((xmin, xmin), (ymin, ymax+2), color='black', linewidth=1.75))
50  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
51  plt.savefig(outfile,dpi = 1000)
52 
53 
def vis_square(data, outfile, title, padsize=1, padval=0)
static float_mat transpose(const float_mat &a)
returns the transposed matrix.
def visualisationForPaperMasterPlot.vis_square_kernel (   data,
  outfile,
  title,
  padsize = 1,
  padval = 0 
)

Definition at line 54 of file visualisationForPaperMasterPlot.py.

References int, PandAna.Demos.demo1.range, and transpose().

54 def vis_square_kernel(data, outfile, title, padsize=1, padval=0):
55  data -= data.min()
56  data /= data.max()
57 
58  # force the number of filters to be square
59  n = int(np.ceil(np.sqrt(data.shape[0])))
60  padding = ((0, n ** 2 - data.shape[0]), (0, padsize), (0, padsize)) + ((0, 0),) * (data.ndim - 3)
61  data = np.pad(data, padding, mode='constant', constant_values=(padval, padval))
62 
63  # tile the filters into an image
64  data = data.reshape((n, n) + data.shape[1:]).transpose((0, 2, 1, 3) + tuple(range(4, data.ndim + 1)))
65  data = data.reshape((n * data.shape[1], n * data.shape[3]) + data.shape[4:])
66  #print type(data)
67  #data=data.squeeze()
68 
69  #print data.shape
70  #print type(data[1][1])
71  #data.astype(np.float64)
72  fig, ax = plt.subplots(figsize=(6,6))
73  plt.axis('off')
74  #ax.set_title(title)
75  ax.xaxis.set_visible(False)
76  ax.yaxis.set_visible(False)
77  ax.set_frame_on(False)
78  ax.set_xlabel('')
79  ax.set_ylabel('')
80  ax.set_xticklabels([])
81  ax.set_yticklabels([])
82  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
83  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
84  plt.savefig(outfile,dpi = 1000)
85 
def vis_square_kernel(data, outfile, title, padsize=1, padval=0)
static float_mat transpose(const float_mat &a)
returns the transposed matrix.
def visualisationForPaperMasterPlot.vis_square_kernel_zoom (   data,
  outfile,
  title,
  xminval,
  xmaxval,
  yminval,
  ymaxval,
  padsize = 1,
  padval = 0 
)

Definition at line 86 of file visualisationForPaperMasterPlot.py.

References int, PandAna.Demos.demo1.range, and transpose().

86 def vis_square_kernel_zoom(data, outfile, title, xminval,xmaxval,yminval,ymaxval,padsize=1, padval=0):
87  data -= data.min()
88  data /= data.max()
89 
90  # force the number of filters to be square
91  n = int(np.ceil(np.sqrt(data.shape[0])))
92  padding = ((0, n ** 2 - data.shape[0]), (0, padsize), (0, padsize)) + ((0, 0),) * (data.ndim - 3)
93  data = np.pad(data, padding, mode='constant', constant_values=(padval, padval))
94 
95  # tile the filters into an image
96  data = data.reshape((n, n) + data.shape[1:]).transpose((0, 2, 1, 3) + tuple(range(4, data.ndim + 1)))
97  data = data.reshape((n * data.shape[1], n * data.shape[3]) + data.shape[4:])
98  #print type(data)
99  #data=data.squeeze()
100 
101  print data.shape
102  #print type(data[1][1])
103  #data.astype(np.float64)
104  fig, ax = plt.subplots(figsize=(6,6))
105  #plt.axis('off')
106  #ax.set_title(title)
107  ax.xaxis.set_visible(False)
108  ax.yaxis.set_visible(False)
109  #ax.set_frame_on(False)
110  ax.set_xlabel('')
111  ax.set_ylabel('')
112  ax.set_xticklabels([])
113  ax.set_yticklabels([])
114  plt.xlim(xminval,xmaxval)
115  plt.ylim(yminval,ymaxval)
116  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
117  plt.imshow(np.rot90(data),cmap='gist_heat_r',interpolation='none')
118  plt.savefig(outfile,dpi = 1000)
119 
120 
121 
def vis_square_kernel_zoom(data, outfile, title, xminval, xmaxval, yminval, ymaxval, padsize=1, padval=0)
static float_mat transpose(const float_mat &a)
returns the transposed matrix.

Variable Documentation

visualisationForPaperMasterPlot.args = parser.parse_args()

Definition at line 128 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.ax
visualisationForPaperMasterPlot.cmap

Definition at line 171 of file visualisationForPaperMasterPlot.py.

Referenced by comi::ChanOcc.analyze(), febstat::FEBShutoff.analyze(), align::AlignInspect.analyze(), mcchk::DetAna.analyze(), dprf::ChannelPlots.analyze(), dprf::TrackPlots.analyze(), febstat::EventFEBStatus.analyze(), sn::SupernovaAna.analyze(), comi::DataCheck.analyze(), calib::HitEfficiency.analyze(), calib::PEResponse.analyze(), comi::NearlineAna.analyze(), LightLevels.analyze(), CerenkovResponse.analyze(), comi::Leana.AnaNHit(), chaninfo::BadChanList.Apply(), dprf::ChannelPlots.beginRun(), calib::DriftResponseCalc.beginRun(), calib::DriftCorrection.beginRun(), chaninfo::FindSwappedChannels.beginSubRun(), slicer::Slicer.BlockSlice(), murem.CompareDigitsByPlaneAndCell(), util.CountXY(), rsim::ReadoutSim.CreateRawDigits(), evd::RawDataDrawer.Draw3DHitBoxes(), calib::FindOutliers.endRun(), util.EventBox(), raw2daq::RawDigit2DAQHit.FillDAQHits(), dprf::ChannelPlots.FillFebRawPlots(), mcdatadaq::DAQSimulator.fillMicroSlices(), daq2raw::DAQHit2Raw.FillRawDigits(), DataCheck::HardwareStatusCheck.filter(), mcdatadaq::DCMSimulator.generateNanoSlice(), calib::DriftResponseCalc.GetChanID(), evd::GeometryDrawer.GetDCMBoxes(), mcdatadaq::DAQSimulator.getNanoSliceOrder(), mcdatadaq::DAQSimulator.init(), chaninfo::BadChanList.LoadNewData(), evtsum::EventSummary.MakeOutput(), mcdatadaq::DAQSimulator.print(), MergeTBDaqCollections::MergeTBDaqCollections.produce(), comi::Cana.produce(), calib::PCHitsList.produce(), calhit::RemoveBadChannels.produce(), calhit::CalHit.produce(), rsim::ReadoutSim.produce(), evd::RawDataDrawer.RawDigit2D(), lem::GenFromLib.readNext(), calib::DriftCorrection.respondToCloseOutputFiles(), and trk::RLFit.RLFit().

visualisationForPaperMasterPlot.correct = 0

Definition at line 131 of file visualisationForPaperMasterPlot.py.

int visualisationForPaperMasterPlot.count = 0

Definition at line 130 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.data = np.asarray([image])

Definition at line 156 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.dataswap = np.swapaxes(data.reshape(np.delete(data.shape,0)),0,2)

Definition at line 158 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.datum = caffe.proto.caffe_pb2.Datum()

Definition at line 146 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.db = leveldb.LevelDB(args.leveldb)

Definition at line 137 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.dpi

Definition at line 174 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.extent
visualisationForPaperMasterPlot.fig

Definition at line 167 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.figsize

Definition at line 167 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.filters1 = net.params['conv1/7x7_s2_y'][0].data

Definition at line 220 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.filters2 = net.params['conv1/7x7_s2_x'][0].data

Definition at line 222 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.iiiax = net.blobs['inception_3a/output_x'].data

Definition at line 239 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.iiiay = net.blobs['inception_3a/output_y'].data

Definition at line 243 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.image = caffe.io.datum_to_array(datum)

Definition at line 151 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.int
visualisationForPaperMasterPlot.interpolation

Definition at line 171 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.iscorrect = plabel

Definition at line 325 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.label = int(datum.label)

Definition at line 148 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.labels_set = set()

Definition at line 133 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.matrix = defaultdict(int)

Definition at line 132 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.net = caffe.Net(args.proto, args.model, caffe.TEST)

Definition at line 135 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.out = net.forward_all(data=np.asarray([image]))

Definition at line 154 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.padval

Definition at line 242 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.parser = argparse.ArgumentParser()

Definition at line 123 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.pidBackground = float(out['prob'][0][0])

Definition at line 316 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.pidSignal = float(out['prob'][0][1])

Definition at line 315 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.plabel = int(out['prob'][0].argmax(axis=0))

Definition at line 155 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.required

Definition at line 124 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.str

Definition at line 124 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.type

Definition at line 124 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.x = x.swapaxes(0,1)

Definition at line 160 of file visualisationForPaperMasterPlot.py.

visualisationForPaperMasterPlot.y = y.swapaxes(0,1)

Definition at line 160 of file visualisationForPaperMasterPlot.py.