Skip to content

Conversation

A-Artemis
Copy link
Contributor

@A-Artemis A-Artemis commented Oct 10, 2025

Summary

Add the implementation for GET and POST of the training configuration

How to test

http://geti-tune.localhost/api/projects/165f79f9-fba5-415b-adda-7e6548ed2c40/training_configuration

image

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@A-Artemis A-Artemis self-assigned this Oct 10, 2025
@A-Artemis A-Artemis linked an issue Oct 10, 2025 that may be closed by this pull request
@github-actions github-actions bot added TEST Any changes in tests Geti Tune Backend Issues related to Geti Tune Studio backend labels Oct 10, 2025
Copy link

github-actions bot commented Oct 10, 2025

Docker Image Sizes

Image Size
geti-tune-pr-4873 1.2G
geti-tune-sha-f8c8aab 1.2G

Copy link

github-actions bot commented Oct 10, 2025

📊 Test coverage report

Metric Coverage
Lines 38.0%
Functions 33.8%
Branches 83.7%
Statements 38.0%

@A-Artemis A-Artemis marked this pull request as ready for review October 10, 2025 11:15
@A-Artemis A-Artemis requested a review from a team as a code owner October 10, 2025 11:15
@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 11:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements GET and POST operations for training configurations, adding a dedicated service layer and endpoints. The implementation replaces placeholder endpoints with full functionality that supports retrieving and updating training configurations for projects and specific model architectures.

  • Added complete service layer with TrainingConfigurationService for managing training configurations
  • Implemented database repository and schema for persisting training configurations
  • Created dedicated API endpoints with proper error handling and validation

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test_training_configurations.py Unit tests for training configuration endpoints
test_training_configuration_service.py Integration tests for the training configuration service
test_initial_schema_migration.py Updated test to verify new training_configurations table
training_configuration_service.py Core service implementing configuration retrieval and update logic
training_configuration.py Enhanced schema with new factory methods and detailed examples
training_configuration_repo.py Repository for database operations on training configurations
schema.py Added TrainingConfigurationDB model with unique constraints
training_configurations.py New dedicated API endpoints for training configuration operations
projects.py Removed placeholder training configuration endpoints
dependencies.py Added dependency injection for training configuration service
da385d690aae_schema.py Database migration to create training_configurations table

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

"""
existing = self.get_by_project_and_model_architecture(project_id, model_architecture_id)

if existing:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need existing check - will it not be able to detect whether to generate update/insert based on provided ids by default?

"evaluation": {"config": {"metrics": ["accuracy", "precision", "recall"], "validation_split": 0.2}},
"dataset_preparation": {
"augmentation": {
"topdown_affine": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Null-valued parameters should be filtered out from the response, because in this context None represents a parameter that's not applicable to the algorithm.

I believe Geti already implements a similar feature. This is an example of response, as you can see there are some empty sections (-> this algorithm doesn't support any augmentation)

image

"gaussian_noise": {"enable": False, "mean": 0, "sigma": 0.1, "probability": 0.5},
"tiling": {"enable": False, "adaptive_tiling": True, "tile_size": 400, "tile_overlap": 0.2},
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the subset_split category is missing?

}
},
"training": {
"max_epochs": 200,
Copy link
Contributor

Choose a reason for hiding this comment

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

The REST endpoint should return a richer representation of each parameter, including the name, description, type, min/max and default values, etc... These details are necessary to the UI to correctly display the parameter.

For reference, here is how the max_epochs parameter looks like in Geti response:

image

…nfiguration retrieval, and use model_copy for model updating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti Tune Backend Issues related to Geti Tune Studio backend TEST Any changes in tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the training configuration endpoints

3 participants