neutompy.recon.nnfbp.astra_plugin

class neutompy.recon.nnfbp.astra_plugin.Network(nHiddenNodes, trainData, valData, setinit=None)[source]

Bases: object

The neural network object that performs all training and reconstruction.

Parameters:
  • nHiddenNodes (int) – The number of hidden nodes in the network.
  • projector (A Projector object (see, for example: nnfbp.SimpleCPUProjector)) – The projector to use.
  • trainData (A DataSet object (see: nnfbp.DataSet)) – The training data set.
  • valData (A DataSet object (see: nnfbp.DataSet)) – The validation data set.
  • reductor (A Reductor object (see: nnfbp.Reductors, default:LogSymReductor)) – Optional reductor to use.
  • nTrain (int) – Number of pixels to pick out of training set.
  • nVal (int) – Number of pixels to pick out of validation set.
  • tmpDir (string) – Optional temporary directory to use.
  • createEmptyClass (boolean) – Used internally when loading from disk, to create an empty object. Do not use directly.
saveAllToDisk(fn)[source]
saveToDisk(fn)[source]

Save a trained network to disk, so that it can be used later without retraining.

Parameters:fn (string) – Filename to save it to.
train()[source]

Train the network using the Levenberg-Marquardt method.

neutompy.recon.nnfbp.astra_plugin.customFBP(W, f, s)[source]
neutompy.recon.nnfbp.astra_plugin.mkdir_p(path)[source]
neutompy.recon.nnfbp.astra_plugin.plugin_train(traindir, nhid, filter_file, val_rat=0.5, setinit=None, saveAll=False)[source]

Traing filters and weights using the NN-FBP method [1].

Options:

‘traindir’: folder where training files are stored ‘nhid’: number of hidden nodes to use ‘filter_file’: file to store trained filters in ‘val_rat’ (optional): fraction of training examples to use as validation ‘saveAll’ (optional): save filters at each iteration instead of final filter only

[1] Pelt, D. M., & Batenburg, K. J. (2013). Fast tomographic reconstruction
from limited data using artificial neural networks. Image Processing, IEEE Transactions on, 22(12), 5238-5251.
neutompy.recon.nnfbp.astra_plugin.sigmoid(x)[source]

Sigmoid function