Difference between revisions of "Process using.m"
(→Outputs) |
(→Examples) |
||
| Line 27: | Line 27: | ||
In the example below, a batch of 100 distribution and DEER trace pairs are generated and processed using the generic distance distribution extraction netset: | 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 default parameters | |
| − | + | parameters=library_dd; | |
| − | + | ||
| − | + | % Number of traces | |
| − | + | parameters.ntraces=100; | |
| − | + | ||
| − | + | % Time and distance point counts | |
| − | + | parameters.np_time=512; | |
| − | + | parameters.np_dist=512; | |
| − | + | ||
| − | + | % PDS experiment type | |
| + | parameters.expt='deer'; | ||
| + | |||
| + | % Generate a test library | ||
| + | library=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: | Neural network answers can be plotted against the known right answers: | ||
% Plot an example | % Plot an example | ||
| − | example=randi(100); figure; | + | example=randi(100); figure(); subplot(1,2,1); |
| − | + | plot(library.time_grid,library.deer_noisy_lib(:,example)); | |
| − | + | kgrid; ktitle('Input DEER trace'); kxlabel('time, s'); | |
| − | + | subplot(1,2,2); plot(library.dist_grid,[answers(:,example) ... | |
| − | subplot(1,2,2); plot(dist_grid,[answers(:,example) dist_distr_lib(:,example)]); | + | library.dist_distr_lib(:,example)]); |
| − | + | kgrid; ktitle('Output distribution'); kxlabel('distance, $\rm{\AA}$'); | |
| − | + | klegend('Network answer','True answer'); | |
| − | |||
The resulting figure is shown below. | The resulting figure is shown below. | ||
Revision as of 08:57, 29 July 2023
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 file containing a neu-
ral network object, including 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 matches 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 default parameters
parameters=library_dd;
% Number of traces
parameters.ntraces=100;
% Time and distance point counts
parameters.np_time=512;
parameters.np_dist=512;
% PDS experiment type
parameters.expt='deer';
% Generate a test library
library=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(library.time_grid,library.deer_noisy_lib(:,example));
kgrid; ktitle('Input DEER trace'); kxlabel('time, s');
subplot(1,2,2); plot(library.dist_grid,[answers(:,example) ...
library.dist_distr_lib(:,example)]);
kgrid; ktitle('Output distribution'); kxlabel('distance, $\rm{\AA}$');
klegend('Network answer','True answer');
The resulting figure is shown below.
Notes
A CUDA capable GPU is not required by this function, it is generally fast enough even on minimal hardware.
See also
Version 2.5, authors: Ilya Kuprov, Steve Worswick
