lincc-frameworks / lincc-frameworks/hyrax

Please add a Model baseclass

Open
#457 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
41
Forks
7
Avg merge
5d 1h
Merged PRs (30d)
8

Description

**Feature request**

For the model development, it would be very helpful to add a base class, which would specify required and optional methods, including type hints for the arguments and return values. This information would provide additional guidelines for users, IDEs, and AIs.

Some specific points:
- `to_tensor` and `forward`: it is not clear that `to_tensor` may output `Tensor` or `tuple[Tensor, Tensor]` and that `forward` may consume it .
- It is not clear where the optimizer comes from, which attribute contains it, and the user needs to know it to write `train_step`.
- Custom model docs [say](https://hyrax.readthedocs.io/en/latest/external_libraries.html#init-self-config-shape) that model's constructor takes two arguments: `config` and `shape`, but actually `data_sample` is passed by the registry.
- It is not clear how to specify a custom criterion.
- Built-int criterion assumes that `ModelClass.config` attribute exists.

**Before submitting**
Please check the following:

- [x] I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
- [ ] I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
- [ ] If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.

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

The issue names no source files, tests, or entry points. Start by tracing the model registry and custom model documentation, including the linked external_libraries page, to document the current constructor, optimizer, criterion, to_tensor, and forward contracts. Done means a scoped base class and type hints address those listed ambiguities with corresponding documentation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.