Difference between revisions of "Deer lib gen.m"
(→Examples) |
(Update function See also links and function index membership) |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
library=deer_lib_gen(file_name,parameters) | library=deer_lib_gen(file_name,parameters) | ||
| − | == | + | ==Parameters== |
Required fields of the parameters.* structure: | Required fields of the parameters.* structure: | ||
max_time - DEER trace duration, seconds | max_time - DEER trace duration, seconds | ||
| − | + | ||
max_exch - maximum exchange coupling, fraction of | max_exch - maximum exchange coupling, fraction of | ||
the maximum frequency representable on | the maximum frequency representable on | ||
| Line 24: | Line 24: | ||
ntraces - number of traces you wish to generate | ntraces - number of traces you wish to generate | ||
| − | + | ||
ndistmax - maximum number of skewed gaussians | ndistmax - maximum number of skewed gaussians | ||
in the distance distribution | in the distance distribution | ||
| Line 91: | Line 91: | ||
without the noise; horizonal stack of | without the noise; horizonal stack of | ||
column vectors | column vectors | ||
| − | + | ||
exchange_lib - exchange interaction (MHz), a row vector | exchange_lib - exchange interaction (MHz), a row vector | ||
containing the value for each example | containing the value for each example | ||
| Line 102: | Line 102: | ||
The example below generates a library of 1000 DEER traces. | The example below generates a library of 1000 DEER traces. | ||
| − | + | % Load default parameters | |
| − | + | parameters=library_dd; | |
| − | + | % Number of traces | |
| − | + | parameters.ntraces=1000; | |
| − | + | % Time and distance point counts | |
| − | + | parameters.np_time=512; | |
parameters.np_dist=512; | parameters.np_dist=512; | ||
| Line 115: | Line 115: | ||
parameters.expt='deer'; | parameters.expt='deer'; | ||
| − | + | % Generate the training library | |
| − | + | library=deer_lib_gen([],parameters); | |
One of the resulting DEER traces is shown below. | One of the resulting DEER traces is shown below. | ||
| Line 129: | Line 129: | ||
==See also== | ==See also== | ||
| − | [[Neural network module]] | + | [[deernet.m]], [[dist_range.m]], [[elexsys2deernet.m]], [[process_using.m]], [[train_one_net.m]], [[Neural network module]], [[Built-in_experiments]] |
| − | |||
| − | [[Built-in_experiments | ||
| − | |||
''Version 2.8, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Jake Keeley]], [[Gunnar Jeschke]]'' | ''Version 2.8, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Jake Keeley]], [[Gunnar Jeschke]]'' | ||
Latest revision as of 19:35, 6 June 2026
Generates a library of distance distributions and corresponding DEER or RIDME traces for use in neural network training. Full details are given in our papers on the subject:
https://doi.org/10.1126/sciadv.aat5218 https://doi.org/10.1073/pnas.2016917118 https://doi.org/10.1016/j.jmr.2022.107186
Syntax
library=deer_lib_gen(file_name,parameters)
Parameters
Required fields of the parameters.* structure:
max_time - DEER trace duration, seconds
max_exch - maximum exchange coupling, fraction of
the maximum frequency representable on
the current time discretisation grid
max_exch - minimum exchange coupling, fraction of
the maximum frequency representable on
the current time discretisation grid
ntraces - number of traces you wish to generate
ndistmax - maximum number of skewed gaussians
in the distance distribution
np_time - number of digitisation points in the
DEER trace
np_dist - number of digitisation points in the
distance distribution
npt_acq - number of digitization points actually
acquired in a sparsely sampled dataset;
points are distributed randomly with
uniform sampling probability
noise_lvl - maximum RMS noise level as a fraction
of the modulation depth (min is zero)
min_fwhm - minimum FWHM for a gaussian in the dis-
tance distribution, fraction of distance
max_fwhm - maximum FWHM for a gaussian in the dis-
tance distribution, fraction of distance
range
max_mdep - minimum DEER modulation depth
min_mdep - maximum DEER modulation depth
expt - background model, 'deer' or 'ridme'
max_brate - maximum background signal decay
rate, s^-1 (DEER backgrounds only)
min_brate - minimum background signal decay
rate, s^-1 (DEER backgrounds only)
min_bdim - minimum background dimensionality
(DEER backgrounds only)
max_bdim - maximum background dimensionality
(DEER backgrounds only)
max_tshift - maximum number of time discretisation
points to shift the trace by, either
forward or backward
Outputs
The function returns library.* structure with the following fields:
time_grid - time grid (seconds) as a row vector
dist_grid - distance grid (Angsrom) as a row vector
dist_distr_lib - all distance distributions as a horizon-
tal stack of column vectors
background_lib - all background signals as a horizonal
stack of column vectors, shifted and
scaled to match DEER/RIDME traces
deer_noisy_lib - all complete DEER/RIDME traces as a
horizonal stack of column vectors
deer_clean_lib - DEER traces as they would come out, but
without the noise; horizonal stack of
column vectors
exchange_lib - exchange interaction (MHz), a row vector
containing the value for each example
parameters - parameters array as received
If a file name is provided, these variables are written into that file.
Examples
The example below generates a library of 1000 DEER traces.
% Load default parameters
parameters=library_dd;
% Number of traces
parameters.ntraces=1000;
% Time and distance point counts
parameters.np_time=512;
parameters.np_dist=512;
% PDS experiment type
parameters.expt='deer';
% Generate the training library
library=deer_lib_gen([],parameters);
One of the resulting DEER traces is shown below.
Notes
Multiple caveats exist in the training process. Please read our papers carefully before training your own networks.
See also
deernet.m, dist_range.m, elexsys2deernet.m, process_using.m, train_one_net.m, Neural network module, Built-in_experiments
Version 2.8, authors: Ilya Kuprov, Steve Worswick, Jake Keeley, Gunnar Jeschke