Skip to content

Commit 9b3ef6e

Browse files
authored
Update photonics.py (#1655)
* Update photonics.py * Update photonics.py
1 parent bfc2c23 commit 9b3ef6e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nevergrad/functions/photonics/photonics.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,18 @@ def cf_photosic_realistic(eps_and_d: np.ndarray) -> float:
429429
def ceviche(
430430
x: np.ndarray, benchmark_type: int = 0, discretize=False, wantgrad=False, wantfields=False
431431
) -> tp.Any:
432+
"""
433+
x = 2d or 3d array of scalars
434+
Inputs:
435+
1. benchmark_type = 0 1 2 or 3, depending on which benchmark you want
436+
2. discretize = True if we want to force x to be in {0,1} (just checks sign(x-0.5) )
437+
3. wantgrad = True if we want to know the gradient
438+
4. wantfields = True if we want the fields of the simulation
439+
Returns:
440+
1. the loss (to be minimized)
441+
2. the gradient or none (depending on wantgrad)
442+
3. the fields or none (depending on wantfields
443+
"""
432444
global first_time_ceviche
433445
global model
434446
import autograd # type: ignore

0 commit comments

Comments
 (0)