tidy3d.plugins.invdes.InverseDesignResult#
- class InverseDesignResult[source]#
Bases:
InvdesBaseModel
Container for the result of an
InverseDesign.run()
call.- Parameters:
attrs (dict = {}) β Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.design (Union[InverseDesign, InverseDesignMulti]) β Specification describing the inverse design problem we wish to optimize.
params (Tuple[ArrayLike, ...] = ()) β History of parameter arrays throughout the optimization.
objective_fn_val (Tuple[float, ...] = ()) β History of objective function values throughout the optimization.
grad (Tuple[ArrayLike, ...] = ()) β History of objective function gradient arrays throughout the optimization.
penalty (Tuple[float, ...] = ()) β History of weighted sum of penalties throughout the optimization.
post_process_val (Tuple[float, ...] = ()) β History of return values from
post_process_fn
throughout the optimization.simulation (Tuple[Simulation, ...] = ()) β History of
td.Simulation
instances throughout the optimization.opt_state (Tuple[dict, ...] = ()) β History of optimizer states throughout the optimization.
Attributes
The history-containing fields as a dictionary of lists.
Keys stored in the history.
Dictionary of last values in
self.history
.The last simulation.
design
penalty
Methods
get
(key[,Β index])Get the value from the history at a certain index (-1 means last).
get_last
(key)Get the last value from the history.
get_sim
([index])Get the simulation at a specific index in the history (list of sims if multi).
get_sim_data
([index])Get the simulation data at a specific index in the history (list of simdata if multi).
Plot the optimization progress from the history.
sim_data_last
(**kwargs)Run the last simulation and return its data.
Inherited Common Usage
- design#
- params#
- objective_fn_val#
- grad#
- penalty#
- post_process_val#
- simulation#
- opt_state#
- property history#
The history-containing fields as a dictionary of lists.
- property keys#
Keys stored in the history.
- property last#
Dictionary of last values in
self.history
.
- get_sim(index=-1)[source]#
Get the simulation at a specific index in the history (list of sims if multi).
- get_sim_data(index=-1, **kwargs)[source]#
Get the simulation data at a specific index in the history (list of simdata if multi).
- property sim_last#
The last simulation.
- __hash__()#
Hash method.