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 an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.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

history

The history-containing fields as a dictionary of lists.

keys

Keys stored in the history.

last

Dictionary of last values in self.history.

sim_last

The last simulation.

design

penalty

attrs

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_optimization()

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(key, index=-1)[source]#

Get the value from the history at a certain index (-1 means last).

get_last(key)[source]#

Get the last value from the 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.

sim_data_last(**kwargs)[source]#

Run the last simulation and return its data.

plot_optimization()[source]#

Plot the optimization progress from the history.

__hash__()#

Hash method.