process_using.m

From Spinach Documentation Wiki
Revision as of 09:06, 23 August 2018 by Admin (talk | contribs) (→‎Examples)
Jump to: navigation, search

Applies the specified trained neural network file to the supplied DEER trace.

Syntax

    answers=process_using(deer_traces,net_file_name)

Arguments

  deer_traces  -  DEER trace(s) as a column vector or a 
                  matrix with multiple columns. The num-
                  ber of rows must match the input size 
                  of the neural network.

  net_file_name - the name of the checkpoint file produ-
                  ced by the train() function of Matlab
                  Neural Network Toolbox, including the
                  full path and the .mat extension.

Outputs

  answers       - neural network output(s) as a column 
                  vector or a matrix with multiple col-
                  umns. The number of rows mathes the 
                  output size of the neural network.

Examples

In the example below, a batch of 100 distribution and DEER trace pairs are generated and processed using the generic distance distribution extraction netset:

       % Load the parameters
       run('net_set_any_peaks/netset_params.m'); 

       % Specify number of traces to produce
       parameters.ntraces=100;
 
       % Generate test batch
       [time_grid,dist_grid,dist_distr_lib,~,~,deer_trace_lib,~,~,parameters]=deer_lib_gen([],parameters);

       % Run the analysis on the example set
       answers=process_using(deer_trace_lib,'net_set_any_peaks/1.mat');

Neural network answers can be plotted against the known right answers:

       % Plot an example
       example=randi(100); figure; 
       subplot(1,2,1); plot(time_grid,deer_trace_lib(:,example)); 
       grid on; title('Input DEER trace');
       xlabel('time, s','interpreter','LaTex');
       subplot(1,2,2); plot(dist_grid,[answers(:,example) dist_distr_lib(:,example)]); 
       grid on; title('Output distribution');
       xlabel('distance, $\rm{\AA}$','interpreter','LaTex');
       legend('Network answer','True answer');

Notes

  • Input and intermediate layers must have the 'tansig' activation function.
  • The function supports 'logsig' or 'tansig' activation functions in the output layer, if a different function is detected then an error will be returned.
  • The function assumes a simple feed-forward network topology.
  • The number of points in the input signal must equal the input layer dimensions.
  • The output signal length will be defined by the network output layer dimensions.
  • Network layers are not required to be uniform.

See also

deernet.m, netset_curate.m


Version 2.2, authors: Ilya Kuprov, Steve Worswick