josiann.Trace
- class josiann.Trace(nb_iterations, nb_walkers, nb_dimensions, run_parameters, initial_position, initial_cost)[source]
Object for storing the trace history of an SA run.
Instantiate a Trace.
- Parameters:
nb_iterations (
int
) – number of expected iterations for the SA algorithm.nb_walkers (
int
) – number of walkers that run in parallel.nb_dimensions (
int
) – number of dimensions per optimization problem.run_parameters (
SAParameters
) – parameters used for running the SA algorithm.initial_position (
ndarray
[Any
,dtype
[float64
]]) – initial positions before running the SA algorithm.initial_cost (
ndarray
[Any
,dtype
[float64
]]) – cost of initial positions.
Attributes
Number of dimensions per optimization problem.
Number of iterations that the SA algorithm run for.
Number of walkers that run in parallel.
Methods
Instantiate a Trace.
When the SA algorithm terminates, finalize() is called on position and parameter traces to delete rows for iterations that where never run.
Plot temperature, number of repeats per iteration and number of averaged function evaluations along iterations.
Plot reached positions and costs for the vector to optimize along iterations.
Attributes
Methods
- Trace.__init__(nb_iterations, nb_walkers, nb_dimensions, run_parameters, initial_position, initial_cost)[source]
Instantiate a Trace.
- Parameters:
nb_iterations (
int
) – number of expected iterations for the SA algorithm.nb_walkers (
int
) – number of walkers that run in parallel.nb_dimensions (
int
) – number of dimensions per optimization problem.run_parameters (
SAParameters
) – parameters used for running the SA algorithm.initial_position (
ndarray
[Any
,dtype
[float64
]]) – initial positions before running the SA algorithm.initial_cost (
ndarray
[Any
,dtype
[float64
]]) – cost of initial positions.
- Trace.finalize(iteration)[source]
When the SA algorithm terminates, finalize() is called on position and parameter traces to delete rows for iterations that where never run.
- Trace.plot_parameters(save=None, show=True)[source]
Plot temperature, number of repeats per iteration and number of averaged function evaluations along iterations.
- abstract Trace.plot_positions(save=None, true_values=None, show=True, walker_titles=None, dimension_titles=None)[source]
Plot reached positions and costs for the vector to optimize along iterations.
- Parameters:
save (
Optional
[Path
] (default:None
)) – optional path to save the plot as a html file.true_values (
Optional
[ndarray
[Any
,dtype
[Any
]]] (default:None
)) – an optional sequence of known true values for each dimension of the vector to optimize.show (
bool
(default:True
)) – render the plot ?walker_titles (
Optional
[Sequence
[str
]] (default:None
)) – an optional list of sub-plot titles, one title per parallel walker.dimension_titles (
Optional
[Sequence
[str
]] (default:None
)) – an optional list of sub-plot titles, one title per dimension.- Return type: