Starfish-develop / Starfish-develop/Starfish

Rewriting the Habib Likelihood Equation

Open
#119 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

low-priority
Dominant language
Python
Stars
78
Forks
23
PR merge metrics
No merged PRs in 30d

Description

@iancze @gully I would love some help on this.

So the Habib likelihood function is great for comparing fitting the GP hyperparameters to the spectra, but I've been wondering if we can rewrite from the perspective of tensors.

To start, instead of representing Sig_w as a block diagonal, why not just use a (m, M, M) tensor? (M is num input params, m is num eigenspectra- following nomenclature from literature/existing code)

Then, when we look at Phi, why not represent it as a tensor with shape (M, Npix, m) or something so that when matrix multiplied with a sample of w will create a tensor with shape (M, Npix) which should also be the shape of the fluxes F instead of concatenating them all together.

I fiddled around the above shapes trying to work through the appendix and match the shapes of everything but I fell short when trying to get the MLE of w- instead of getting shape (m,) I always had a rank 2 tensor.

If we can figure out a way to rework the Habib implementation from the view of tensors I think our code will be much more elegant and easy to parse, along with being more easily vectorized using PyTorch or similar.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the current Habib likelihood implementation and tracing the representations of Sig_w, Phi, fluxes F, and the MLE of w. Work through the appendix and existing code to verify each proposed tensor shape; done would mean a coherent tensor-based formulation with a correctly shaped MLE and evidence that it can be vectorized.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.