Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified Node Configuration #79

Merged
merged 6 commits into from
Sep 27, 2024
Merged

Simplified Node Configuration #79

merged 6 commits into from
Sep 27, 2024

Conversation

kozlov721
Copy link
Collaborator

@kozlov721 kozlov721 commented Sep 21, 2024

  • metrics, losses, and visualizers can be defined under their respective nodes instead of in separate fields under model
    • No need to specify the attached_to field for such modules
    • The old way is still supported, but raises a deprecation warning
  • node.inputs not required for simple models following head -> (neck?) -> head1, head2, ... topology
    • The nodes must be defined in the config in this exact order
    • For multihead networks, the heads must have "Head" in their name for this to work

Example

Old Config

model:
  name: resnet50_classification
  nodes:
    - name: ResNet
      params:
        variant: "50"
        download_weights: True

    - name: ClassificationHead
      inputs:
        - ResNet

  losses:
    - name: CrossEntropyLoss
      attached_to: ClassificationHead

  metrics:
    - name: Accuracy
      is_main_metric: true
      attached_to: ClassificationHead
    - name: Recall
      attached_to: ClassificationHead


  visualizers:
    - name: ClassificationVisualizer
      attached_to: ClassificationHead

New Config

model:
  name: resnet50_classification
  nodes:
    - name: ResNet
      params:
        variant: "50"
        download_weights: True

    - name: ClassificationHead

      losses:
        name: CrossEntropyLoss

      metrics:
        - name: Accuracy
          is_main_metric: true
        - name: Recall

      visualizers:
        name: ClassificationVisualizer

@kozlov721 kozlov721 requested a review from a team as a code owner September 21, 2024 07:59
@kozlov721 kozlov721 requested review from klemen1999, tersekmatija and conorsim and removed request for a team September 21, 2024 07:59
@kozlov721 kozlov721 self-assigned this Sep 21, 2024
@kozlov721 kozlov721 added the enhancement New feature or request label Sep 21, 2024
Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

luxonis_train/config/config.py Show resolved Hide resolved
Base automatically changed from feature/decouple-config to dev September 24, 2024 16:46
Copy link

Test Results

  1 files    1 suites   23m 38s ⏱️
129 tests 129 ✅ 0 💤 0 ❌
180 runs  180 ✅ 0 💤 0 ❌

Results for commit 9c84111.

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5342 5147 96% 90% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
luxonis_train/config/config.py 93% 🟢
TOTAL 93% 🟢

updated for commit: 9c84111 by action🐍

@kozlov721 kozlov721 merged commit a7048e2 into dev Sep 27, 2024
8 checks passed
@kozlov721 kozlov721 deleted the feature/simplify-config branch September 27, 2024 01:45
kozlov721 added a commit that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants