mirror of
https://github.com/TaterTotterson/microWakeWord-Trainer-Nvidia-Docker.git
synced 2026-06-12 20:10:19 -06:00
Sat Samples
This commit is contained in:
@@ -111,6 +111,16 @@ else
|
||||
echo "ℹ️ No personal features found at ${PERSONAL_FEATURES_DIR}/training (continuing without personal weighting)"
|
||||
fi
|
||||
|
||||
# Reviewed false-positive features are optional hard negatives.
|
||||
REVIEWED_NEGATIVE_FEATURES_DIR="${WORK_DIR}/reviewed_negative_features"
|
||||
HAS_REVIEWED_NEGATIVE="false"
|
||||
if [ -d "${REVIEWED_NEGATIVE_FEATURES_DIR}/training" ] ; then
|
||||
HAS_REVIEWED_NEGATIVE="true"
|
||||
echo "✅ Found reviewed negative features: ${REVIEWED_NEGATIVE_FEATURES_DIR}/training (will weight as hard negatives)"
|
||||
else
|
||||
echo "ℹ️ No reviewed negative features found at ${REVIEWED_NEGATIVE_FEATURES_DIR}/training (continuing with stock negatives)"
|
||||
fi
|
||||
|
||||
cd "${WORK_DIR}"
|
||||
|
||||
echo "===== Starting ${TRAINING_STEPS} training steps ====="
|
||||
@@ -133,6 +143,7 @@ features:
|
||||
truth: true
|
||||
type: mmap
|
||||
__PERSONAL_FEATURE_MARKER__
|
||||
__REVIEWED_NEGATIVE_FEATURE_MARKER__
|
||||
- features_dir: __NEG_SPEECH__
|
||||
penalty_weight: 1.0
|
||||
sampling_weight: 12.0
|
||||
@@ -208,6 +219,22 @@ else
|
||||
sed -i -e "/__PERSONAL_FEATURE_MARKER__/d" "${YAML_PATH}"
|
||||
fi
|
||||
|
||||
# Insert/remove reviewed hard-negative block
|
||||
if [ "${HAS_REVIEWED_NEGATIVE}" = "true" ]; then
|
||||
reviewed_negative_block="$(cat <<EOF
|
||||
- features_dir: ${REVIEWED_NEGATIVE_FEATURES_DIR}
|
||||
penalty_weight: 1.25
|
||||
sampling_weight: 8.0
|
||||
truncation_strategy: random
|
||||
truth: false
|
||||
type: mmap
|
||||
EOF
|
||||
)"
|
||||
perl -0777 -i -pe "s#__REVIEWED_NEGATIVE_FEATURE_MARKER__#${reviewed_negative_block}#g" "${YAML_PATH}"
|
||||
else
|
||||
sed -i -e "/__REVIEWED_NEGATIVE_FEATURE_MARKER__/d" "${YAML_PATH}"
|
||||
fi
|
||||
|
||||
echo " Wrote training_parameters.yaml"
|
||||
rm -rf "${WORK_DIR}/trained_models/wakeword"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user