From 797339a02f3334ea35b98246f0015be04bd4b83f Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 27 Jul 2026 15:50:07 +0200 Subject: [PATCH] Rename GUI labels to L1 Lambda / L2 Lambda, wire up L1 control Visible captions "Lambda" and "Weight decay" renamed to "L1 Lambda" and "L2 Lambda" in both the main params panel (MainComponent.cpp) and the per-layer view (RbmComponent.cpp), matching the backend Rbm::Params field names (l1Lambda, l2Lambda). lambdaLabel's change handler was a dead stub (tooltip said "Unused", body did nothing) -- wired it up to write params().l1Lambda, mirroring weightDecayLabel's existing l2Lambda handler. Also added the matching lambdaLabel->setText(...) sync in updateControls(), which weightDecay already had but lambdaLabel never did, so the field now actually displays the loaded value instead of always showing its default. Verified by launching the GUI and screenshotting it: both labels render correctly, values populate, no layout/truncation issues. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs --- source/MainComponent.cpp | 8 +++++--- source/RbmComponent.cpp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/MainComponent.cpp b/source/MainComponent.cpp index 03b4ca2..3946e76 100644 --- a/source/MainComponent.cpp +++ b/source/MainComponent.cpp @@ -198,7 +198,7 @@ MainComponent::MainComponent (const String prjname) addAndMakeVisible (lambdaLabel = new Label ("Lambda label", TRANS("1.0"))); - lambdaLabel->setTooltip (TRANS("Unused")); + lambdaLabel->setTooltip (TRANS("L1 regularization strength (sparsity)")); lambdaLabel->setFont (Font (15.00f, Font::plain)); lambdaLabel->setJustificationType (Justification::centred); lambdaLabel->setEditable (true, true, false); @@ -411,7 +411,7 @@ void MainComponent::paint (Graphics& g) g.setColour (Colours::black); g.setFont (Font (15.00f, Font::plain)); - g.drawText (TRANS("Lambda"), + g.drawText (TRANS("L1 Lambda"), 648, 138, 80, 14, Justification::centred, true); @@ -441,7 +441,7 @@ void MainComponent::paint (Graphics& g) g.setColour (Colours::black); g.setFont (Font (15.00f, Font::plain)); - g.drawText (TRANS("Weight decay"), + g.drawText (TRANS("L2 Lambda"), 824, 186, 96, 14, Justification::centred, true); @@ -764,6 +764,7 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged) else if (labelThatHasChanged == lambdaLabel) { //[UserLabelCode_lambdaLabel] -- add your label text handling code here.. + m_pLayer->params().l1Lambda = labelThatHasChanged->getText().getFloatValue(); //[/UserLabelCode_lambdaLabel] } else if (labelThatHasChanged == sigmaLabel) @@ -948,6 +949,7 @@ void MainComponent::updateControls() rbmDoSampleHidden->setToggleState(m_pLayer->params().gibbsDoSampleHidden, dontSendNotification); weightDecayLabel->setText(String(m_pLayer->params().l2Lambda), dontSendNotification); + lambdaLabel->setText(String(m_pLayer->params().l1Lambda), dontSendNotification); learningRateLabel->setText(String(m_pLayer->params().learningRate), dontSendNotification); momentumLabel->setText(String(m_pLayer->params().momentum), dontSendNotification); numVisibleLabel->setText(String(m_pLayer->numVisibleX()), dontSendNotification ); diff --git a/source/RbmComponent.cpp b/source/RbmComponent.cpp index e5fb615..5bcd70d 100644 --- a/source/RbmComponent.cpp +++ b/source/RbmComponent.cpp @@ -105,7 +105,7 @@ void RbmComponent::paint (Graphics& g) g.setColour (Colours::black); g.setFont (Font (15.00f, Font::plain)); - g.drawText (TRANS("Lambda"), + g.drawText (TRANS("L1 Lambda"), 120, 306, 80, 14, Justification::centred, true); @@ -135,7 +135,7 @@ void RbmComponent::paint (Graphics& g) g.setColour (Colours::black); g.setFont (Font (15.00f, Font::plain)); - g.drawText (TRANS("Weight decay"), + g.drawText (TRANS("L2 Lambda"), 296, 354, 96, 14, Justification::centred, true);