Skip to content

fix: add frontend validation for Dropout rate and Input layer dimensions#283

Open
Rkx-01 wants to merge 1 commit intoc2siorg:mainfrom
Rkx-01:fix/frontend-layer-validation
Open

fix: add frontend validation for Dropout rate and Input layer dimensions#283
Rkx-01 wants to merge 1 commit intoc2siorg:mainfrom
Rkx-01:fix/frontend-layer-validation

Conversation

@Rkx-01
Copy link
Copy Markdown
Contributor

@Rkx-01 Rkx-01 commented Apr 3, 2026

Part 2 for fixing #263.

Changes:

  • NodePropertiesPanel.jsx: clamped Dropout rate to [0, 0.9]; enforced min=1 and int for Input layer dimensions
  • Helpers.jsx: guarded canSaveModel() with input integer checks and dropout rate validations so models cannot be saved with invalid inputs

@Rkx-01 Rkx-01 force-pushed the fix/frontend-layer-validation branch from 6f7f27c to cd55c95 Compare April 3, 2026 21:38
@ivantha
Copy link
Copy Markdown
Member

ivantha commented Apr 13, 2026

This PR's head branch is behind main. Please rebase onto the latest main (e.g. git fetch origin && git rebase origin/main) and force-push to make it mergeable.

@Rkx-01 Rkx-01 force-pushed the fix/frontend-layer-validation branch 2 times, most recently from 0827cad to a001891 Compare April 19, 2026 11:34
@Rkx-01
Copy link
Copy Markdown
Contributor Author

Rkx-01 commented Apr 19, 2026

Hi @ivantha!

The branch has been fully cleaned up: rebased onto latest main, squashed into a single commit, all lint/format checks passing.

Ready to merge!

Addresses c2siorg#263.

Three validation gaps allowed invalid models to be built silently:
- Dropout rate had no lower/upper bound enforcement; users could type
  values like 5 or -1 which the backend rejects with HTTP 400
- Input layer dimension inputs accepted 0 and negative values which
  are invalid for Keras input shapes
- canSaveModel() in Helpers.jsx had no guard for dropout nodes, so
  a model with an unconfigured or out-of-range dropout rate could
  still be saved

Changes:
- NodePropertiesPanel.jsx: clamp Dropout rate to [0, 0.9] on input;
  enforce min=1 and integer-only values for all Input layer dimensions
- Helpers.jsx: add custominput positive-integer guard and customdropout
  rate validation to canSaveModel() so the Save button stays disabled
  until all params are valid
@Rkx-01 Rkx-01 force-pushed the fix/frontend-layer-validation branch from 010b32a to dc051cd Compare April 25, 2026 20:19
@Rkx-01
Copy link
Copy Markdown
Contributor Author

Rkx-01 commented Apr 25, 2026

Hi @ivantha!

The branch has been fully cleaned up: rebased onto latest main, squashed into a single commit, all lint/format checks passing.

Ready to merge!

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.

2 participants