Difference between revisions of "Process using.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Examples)
(→‎Notes)
Line 57: Line 57:
  
 
==Notes==
 
==Notes==
−
*Input and intermediate layers must have the [[train_one_net.m#tansig_func|'tansig']] activation function.
+
*Input and intermediate layers must have the [[train_one_net.m#tansig_func|tansig]] activation function.
−
*The function supports [[train_one_net.m#logsig_func|'logsig']] or [[train_one_net.m#tansig_func|'tansig']] activation functions in the output layer, if a different function is detected then an error will be returned.
+
*The function supports [[train_one_net.m#logsig_func|'logsig']] or [[train_one_net.m#tansig_func|'tansig']] activation functions in the output layer. If a different function is detected, an error will be returned.
−
*The function assumes a simple feed-forward network topology.  
+
*The function assumes simple feed-forward network topology.  
−
*The number of points in the input signal must equal the input layer dimensions.  
+
*The number of points in the input signal must equal the input layer dimension.  
−
*The output signal length will be defined by the network output layer dimensions.
+
*The output signal length will be defined by the network output layer dimension.
−
*Network layers are '''not''' required to be uniform.
 
  
 
==See also==
 
==See also==

Revision as of 09:08, 23 August 2018

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');

The resulting figure is shown below.

Process using.png

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, an error will be returned.
  • The function assumes simple feed-forward network topology.
  • The number of points in the input signal must equal the input layer dimension.
  • The output signal length will be defined by the network output layer dimension.

See also

deernet.m, netset_curate.m


Version 2.2, authors: Ilya Kuprov, Steve Worswick