neutompy.recon.nnfbp.TrainingData

class neutompy.recon.nnfbp.TrainingData.MATTrainingData(fls, dataname='mat')[source]

Bases: neutompy.recon.nnfbp.TrainingData.TrainingData

Implementation of TrainingData that uses a MAT files to store data.

getDataBlock(i)[source]

Get a block of data from the set.

Parameters:i (int) – Position of block to get.
Returns:numpy.ndarray – Block of data.
normalizeData(minL, maxL, minIn, maxIn)[source]

Normalize the set such that every column is in range (0,1), except for the last column, which will be normalized to (0.25,0.75). Parameters are like getMinMax().

class neutompy.recon.nnfbp.TrainingData.TrainingData(data, nPoints, network, blockSize=10000)[source]

Bases: object

Base object of a class that represents training or validation data used during training of a network.

An implementing class should define getDataBlock, addDataBlock and normalizeData methods. See, for example, HDF5TrainingData.

Parameters:
  • data (DataSet) – Dataset to pick pixels from. (see nnfbp.DataSet)
  • nPoints (int) – Number of pixels to pick.
  • blockSize (int) – Size of each data block.
addDataBlock(data, i)[source]

Add a block of data to the set.

Parameters:
  • data (numpy.ndarray) – Block of data to add.
  • i (int) – Position to add block to.
close()[source]

Close the underlying file.

getDataBlock(i)[source]

Get a block of data from the set.

Parameters:i (int) – Position of block to get.
Returns:numpy.ndarray – Block of data.
getMinMax()[source]

Returns the minimum and maximum values of each column of the entire set.

Returns:tuple with:
  • minLnumpy.ndarray with minimum value of each column except last.
  • maxLnumpy.ndarray with maximum value of each column except last.
  • minInfloat minimum values of last column.
  • maxInfloat maximum values of last column.
normalizeData(minL, maxL, minIn, maxIn)[source]

Normalize the set such that every column is in range (0,1), except for the last column, which will be normalized to (0.25,0.75). Parameters are like getMinMax().