Difference between revisions of "Deer lib gen.m"
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:deer_lib_gen.m}} __NOTOC__ | {{DISPLAYTITLE:deer_lib_gen.m}} __NOTOC__ | ||
| − | Generates a library of distance distributions and corresponding DEER traces for use in neural network training. Full details are given in our [https://dx.doi.org/10.1126/sciadv.aat5218 paper] on the subject. | + | Generates a library of distance distributions and corresponding DEER or RIDME traces for use in neural network training. Full details are given in our [https://dx.doi.org/10.1126/sciadv.aat5218 paper] on the subject. |
==Syntax== | ==Syntax== | ||
| − | + | library=deer_lib_gen(file_name,parameters) | |
| − | |||
| − | |||
==Arguments== | ==Arguments== | ||
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 | ||
| + | the maximum frequency representable on | ||
| + | the current time discretisation grid | ||
| − | max_exch - | + | 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 | 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 | ||
| − | + | np_time - number of digitisation points in the | |
| − | DEER trace | + | DEER trace |
| − | |||
| − | noise_lvl - RMS noise level as a fraction of the | + | 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- | min_fwhm - minimum FWHM for a gaussian in the dis- | ||
| Line 47: | Line 48: | ||
min_mdep - maximum DEER modulation depth | min_mdep - maximum DEER modulation depth | ||
| + | |||
| + | expt - background model, 'deer' or 'ridme' | ||
max_brate - maximum background signal decay | max_brate - maximum background signal decay | ||
| − | rate, s^-1 | + | rate, s^-1 (DEER backgrounds only) |
min_brate - minimum background signal decay | min_brate - minimum background signal decay | ||
| − | rate, s^-1 | + | rate, s^-1 (DEER backgrounds only) |
min_bdim - minimum background dimensionality | min_bdim - minimum background dimensionality | ||
| + | (DEER backgrounds only) | ||
max_bdim - maximum background dimensionality | 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== | ==Outputs== | ||
| + | The function returns library.* structure with the following fields: | ||
time_grid - time grid (seconds) as a row vector | time_grid - time grid (seconds) as a row vector | ||
| Line 64: | Line 74: | ||
dist_grid - distance grid (Angsrom) as a row vector | dist_grid - distance grid (Angsrom) as a row vector | ||
| − | dist_distr_lib - all distance distributions as a | + | dist_distr_lib - all distance distributions as a horizon- |
| − | + | tal stack of column vectors | |
| − | |||
| − | |||
| − | stack of | ||
background_lib - all background signals as a horizonal | background_lib - all background signals as a horizonal | ||
| − | stack of | + | stack of column vectors, shifted and |
| − | to match DEER traces | + | scaled to match DEER/RIDME traces |
| − | + | deer_noisy_lib - all complete DEER/RIDME traces as a | |
| − | stack of | + | horizonal stack of column vectors |
deer_clean_lib - DEER traces as they would come out, but | deer_clean_lib - DEER traces as they would come out, but | ||
| − | without the noise | + | without the noise; horizonal stack of |
| + | column vectors | ||
exchange_lib - exchange interaction (MHz), a row vector | exchange_lib - exchange interaction (MHz), a row vector | ||
| − | + | containing the value for each example | |
parameters - parameters array as received | parameters - parameters array as received | ||
Revision as of 09:22, 29 July 2023
Generates a library of distance distributions and corresponding DEER or RIDME traces for use in neural network training. Full details are given in our paper on the subject.
Syntax
library=deer_lib_gen(file_name,parameters)
Arguments
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 loads the parameters from one of the example files and generates a library of 1000 DEER traces.
% Load the training set parameters
netset_params;
% Specify number of traces to produce
parameters.ntraces=1000;
% Set the training database name
file_name='dlg_example_set.mat';
% Generate the training library
[time_grid,dist_grid,dist_distr_lib,...
deer_ffact_lib,background_lib,deer_trace_lib,...
deer_clean_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)
One of the resulting DEER traces is shown below.
Notes
Multiple caveats exist in the training process. Please read our paper carefully before training your own networks.
See also
Version 2.5, authors: Ilya Kuprov, Steve Worswick, Jake Keeley, Gunnar Jeschke