Skip to content

Commit

Permalink
Merge pull request #137 from invrs-io/splitter
Browse files Browse the repository at this point in the history
Fix diffractive splitter eval metric
  • Loading branch information
mfschubert authored Jul 27, 2024
2 parents 69c21f0 + 471201d commit fb9972c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "v1.1.0"
current_version = "v1.1.1"
commit = true
commit_args = "--no-verify"
tag = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# invrs-gym
`v1.1.0`
`v1.1.1`

## Overview
The `invrs_gym` package is an open-source gym containing a diverse set of photonic design challenges, which are relevant for a wide range of applications such as AR/VR, optical networking, LIDAR, and others.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]

name = "invrs_gym"
version = "v1.1.0"
version = "v1.1.1"
description = "A collection of inverse design challenges"
keywords = ["topology", "optimization", "jax", "inverse design"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/invrs_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (c) 2023 The INVRS-IO authors.
"""

__version__ = "v1.1.0"
__version__ = "v1.1.1"
__author__ = "Martin F. Schubert <[email protected]>"

from invrs_gym import challenges as challenges
Expand Down
10 changes: 5 additions & 5 deletions src/invrs_gym/challenges/diffract/splitter_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ def eval_metric(self, response: common.GratingResponse) -> jnp.ndarray:

# Total efficiency, i.e. sum of power into all output orders. A perfect
# solution has a value of `1`, and the lowest possible value is `0`.
total_efficiency = jnp.sum(transmission, axis=(-2, -1))
total_efficiency = jnp.sum(transmission, axis=(-3, -2, -1))

# Uniformity error. The perfect solution has a uniformity error of `0`,
# and the highest possible value is `1`.
uniformity_error = (
jnp.amax(transmission, axis=(-2, -1))
- jnp.amin(transmission, axis=(-2, -1))
jnp.amax(transmission, axis=(-3, -2, -1))
- jnp.amin(transmission, axis=(-3, -2, -1))
) / (
jnp.amax(transmission, axis=(-2, -1))
+ jnp.amin(transmission, axis=(-2, -1))
jnp.amax(transmission, axis=(-3, -2, -1))
+ jnp.amin(transmission, axis=(-3, -2, -1))
)

return jnp.amin(total_efficiency * (1 - uniformity_error))
Expand Down

0 comments on commit fb9972c

Please sign in to comment.