Skip to content

Commit b568f6f

Browse files
committed
documenting the configuration file
1 parent baae344 commit b568f6f

File tree

1 file changed

+80
-4
lines changed

1 file changed

+80
-4
lines changed

src/config.py

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,84 @@
11
""" General configuration file.
2+
Summary
3+
-------
4+
This module contains all the configuration parameters that define the details
5+
of the DGCG algorithm. Al parameters are set at execution of `DGCG.solve`
6+
and then remain fixed.
7+
8+
Members
9+
-------
10+
results_folder : str, default 'results'
11+
By default, the algorithm stores at each iteration the iterate, graphs
12+
the convergence plots, dual gaps, found stationary points, etc.
13+
This variable indicates the name of the folder in which these are stored.
14+
logger : misc.logger class, default None
15+
The logger class is involved in all the logging activities, like plotting,
16+
pickling data, terminal printing, etc. A logger object is created and then
17+
accessed by all the modules here via `config.logger`.
18+
T : int, default 51
19+
The number of time samples of the problem.
20+
time : numpy.ndarray, default np.linspace(0, 1, T)
21+
The respective time samples of the problem.
22+
time_weights : numpt.ndarrat, default np.ones(T)/T
23+
The associated weights to each time sample. By default, these are equally
24+
weighted summing up to 1. Relevant when dealing with different uncertainty
25+
values for each time sample.
26+
alpha : numpy.float, default 0.1
27+
Regularization coefficient of the problem
28+
beta : numpy.float, default 0.1
29+
Regularization coefficient of the problem
30+
f_t : list of numpy.ndarray, default None
31+
Input data in the problem, represents a list of elements in H_t for each t.
32+
measure_coefficient_too_low : numpy.float, default 1e-18
33+
The measure class is a weighted sum of atoms. When the weight of an
34+
atom is lower than this threshold, it is automatically discarded.
35+
full_max_iteration : int, default 1000
36+
Maximum number of iterations of the algorithm.
37+
insertion_max_segments : int, default 20
38+
In the insertion step, during the multistart gradient descent, random
39+
curves are proposed for descense in insertion_mod.random_insertion
40+
The number of segments of the random curves is chosen at random, with
41+
this parameter defining the upper limit on the chosen segments.
42+
rejection_sampling_epsilon : numpy.float, default 0.05
43+
When generating random curves for insertion at
44+
insertion_mod.random_insertion, once the time nodes of the curve is
45+
defined, the spatial positions are chosed via the rejection_sampling
46+
algorithm. This parameter is involved in the definition of used function.
47+
In principle, the higher is this number, the faster the rejection sampling
48+
algorithm will find a candidate. But simultaneously, it will miss possible
49+
candidates that have values barely above 0.
50+
insertion_length_bound_factor : numpy.float, default 1.1
51+
When proposing curves to descend in insertion_mod.propose, it is known
52+
from the theory that any solution must not exceed a certain length that
53+
can be computed. If any proposed curve surpases this limit by a factor
54+
given by this parameter, it is automatically discarded.
55+
multistart_pooling_number : int, default 1000
56+
When proposing random curves, many random curves are proposed and
57+
afterwards, before descending them, we choose the best one from this group
58+
The size of the generated random curves is defined by this parameter.
59+
The criteria to choose the best curve is one that has the least F(γ) value.
60+
crossover_consecutive_inserts : int, default 30
61+
The proposing method at insertion_mod.propose switches between choosing
62+
a crossover curve or a random curve. For each N crossover propositions
63+
it does 1 random proposition. N here corresponds to this parameter.
64+
crossover_search_attempts : int, default 1000
65+
To crossover curves the algorithm must look for curves that are close
66+
enough to crossover and then check if these have been crossover beforehand.
67+
This information is contained in the sort-of-dictionary object
68+
insertion_mod.ordered_list_of_lists, and to look for new pairs it will
69+
randomly access the entries to see if a crossover can be obtained.
70+
It will attempt this random entries the number given by the his parameters,
71+
if no crossover is found after this search, insertion_mod.propose will
72+
declare that there are no available crossovers and then will propose a
73+
random curve for descent.
74+
crossover_child_F_threshold : numpy.float, default 0.8
75+
76+
77+
78+
79+
80+
Extensive description of each parameter of this module
281
3-
This module contains all the parameters that define the details of the DGCG
4-
algorithm
5-
<+TODO+> description of each parameter
682
"""
783
# Standard imports
884
import pickle
@@ -53,7 +129,7 @@ def self_pickle(filename):
53129
insertion_max_segments = 20
54130
rejection_sampling_epsilon = 0.05
55131
insertion_length_bound_factor = 1.1
56-
multistart_pooling_num = 5000
132+
multistart_pooling_num = 1000
57133

58134
# Crossover parameter
59135
crossover_consecutive_inserts = 30

0 commit comments

Comments
 (0)