Skip to content

Changing how Lambdas are normalized if Simplex=True#2

Open
facero wants to merge 1 commit into
jbobin:devlfrom
facero:devl
Open

Changing how Lambdas are normalized if Simplex=True#2
facero wants to merge 1 commit into
jbobin:devlfrom
facero:devl

Conversation

@facero
Copy link
Copy Markdown
Collaborator

@facero facero commented Apr 28, 2022

When testing the IAE and the BSP on X-ray spectra, the BSP was giving strange spectra in ~5-10% of the cases.
Investigation revealed that this was due to the simplex constraint not being followed (Sum(Lambdas)>1) hence producing strange spectra as an output.

This PR modifies two things:

  • Lambdas need to be divided by sum(L) not sum(abs(L))
  • new Lambdas were not updated in params["Lambda"]

When testing Sum(L) is now 1 for the cases I tested and BSP and FastInterp now provide consistent results.

Two issues here:
- Lambdas need to be divided by sum(L) not sum(abs(L))
- new Lambdas were not updated in params["Lambda"]
When testing Sum(L) is 1 now (not the case before).
@facero
Copy link
Copy Markdown
Collaborator Author

facero commented Apr 28, 2022

Note that in the interpolator the absolute value is not present which would explain why FI was working and not BSP

Lambda = Lambda / (np.sum(Lambda, axis=1)[:, np.newaxis] + 1e-3) # not really a projection on the simplex

However a similar issue could exist here in the sparse_code interpolator where the absolute value is present. Maybe its worth fixing it as well.

Lambda = Lambda / (np.sum(np.abs(Lambda), axis=1)[:, np.newaxis] + 1e-3) # not really a projection on the simplex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant