From 6bc711d52e796fb3d041c9143153f349ee50750e Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Wed, 22 Oct 2025 23:24:17 -0400 Subject: [PATCH 1/6] [US-IF-008]: Implement DecoderLayer Forward pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace NotImplementedException with NotSupportedException in single-parameter Forward method - Add comprehensive documentation explaining that DecoderLayer requires multiple inputs - Fix syntax error in BayesianOptimizerOptions.cs (missing Kernel property declaration) The Forward(Tensor input) method now properly throws NotSupportedException since this layer requires at least two inputs (decoder input and encoder output) to function. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Models/Options/BayesianOptimizerOptions.cs | 12 ++++++------ src/NeuralNetworks/Layers/DecoderLayer.cs | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Models/Options/BayesianOptimizerOptions.cs b/src/Models/Options/BayesianOptimizerOptions.cs index 3d54d3e464..0ab7624cc7 100644 --- a/src/Models/Options/BayesianOptimizerOptions.cs +++ b/src/Models/Options/BayesianOptimizerOptions.cs @@ -128,16 +128,16 @@ public class BayesianOptimizerOptions : OptimizationAlgorith /// The kernel function determines how the algorithm measures similarity between points in the search space, /// which affects how it generalizes from observed data points to unobserved points. /// - /// For Beginners: The kernel function helps the algorithm understand how similar different points are - /// to each other. The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will - /// have similar values, with the similarity decreasing smoothly as distance increases. This is like assuming that in - /// our hilly landscape, nearby locations tend to have similar heights. The Gaussian kernel works well for many problems, + /// For Beginners: The kernel function helps the algorithm understand how similar different points are + /// to each other. The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will + /// have similar values, with the similarity decreasing smoothly as distance increases. This is like assuming that in + /// our hilly landscape, nearby locations tend to have similar heights. The Gaussian kernel works well for many problems, /// especially when the underlying function is smooth. /// - + public IKernel Kernel { get; set; } = new GaussianKernel(); + /// /// Gets or sets whether the objective should be maximized (true) or minimized (false). /// public bool IsMaximization { get; set; } = true; - set; } = new GaussianKernel(); } diff --git a/src/NeuralNetworks/Layers/DecoderLayer.cs b/src/NeuralNetworks/Layers/DecoderLayer.cs index 482b906d4b..83d33c936e 100644 --- a/src/NeuralNetworks/Layers/DecoderLayer.cs +++ b/src/NeuralNetworks/Layers/DecoderLayer.cs @@ -368,9 +368,19 @@ public override void ResetState() _norm3.ResetState(); } + /// + /// Single-parameter forward pass is not supported for DecoderLayer. + /// + /// The input tensor. + /// Not applicable - this method always throws. + /// Always thrown as this layer requires multiple inputs. + /// + /// For Beginners: The DecoderLayer requires at least two inputs (decoder input and encoder output), + /// so it cannot work with just a single input tensor. Use the multi-parameter Forward method instead. + /// public override Tensor Forward(Tensor input) { - throw new NotImplementedException(); + throw new NotSupportedException("DecoderLayer requires multiple inputs. Use Forward(params Tensor[] inputs) with at least two tensors: decoder input and encoder output."); } /// From f028ce0a359095c7aac64ffea5e90bd6ce40cb85 Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Wed, 22 Oct 2025 23:42:04 -0400 Subject: [PATCH 2/6] docs: enhance Kernel property XML documentation in BayesianOptimizerOptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve the comprehensiveness of the Kernel property documentation by: - Adding more detail to the summary tag about measuring similarity - Expanding the remarks to mention that different kernel functions can be used depending on the expected structure of the objective function This ensures the documentation matches the comprehensive pattern used throughout the file and addresses the Copilot review comment. Addresses Copilot review comment in PR #167. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Models/Options/BayesianOptimizerOptions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Models/Options/BayesianOptimizerOptions.cs b/src/Models/Options/BayesianOptimizerOptions.cs index 0ab7624cc7..671b13b2ab 100644 --- a/src/Models/Options/BayesianOptimizerOptions.cs +++ b/src/Models/Options/BayesianOptimizerOptions.cs @@ -120,13 +120,14 @@ public class BayesianOptimizerOptions : OptimizationAlgorith public AcquisitionFunctionType AcquisitionFunction { get; set; } = AcquisitionFunctionType.UpperConfidenceBound; /// - /// Gets or sets the kernel function used by the Gaussian Process model. + /// Gets or sets the kernel function used by the Gaussian Process model for measuring similarity between points. /// /// The kernel function, defaulting to Gaussian kernel (also known as Radial Basis Function kernel). /// /// /// The kernel function determines how the algorithm measures similarity between points in the search space, - /// which affects how it generalizes from observed data points to unobserved points. + /// which affects how it generalizes from observed data points to unobserved points. Different kernel functions + /// can be used depending on the expected structure of the objective function. /// /// For Beginners: The kernel function helps the algorithm understand how similar different points are /// to each other. The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will From 0142b90d1ca60b80d81e89d93d5fcbf777996aca Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Thu, 23 Oct 2025 00:26:19 -0400 Subject: [PATCH 3/6] fix: remove worktrees directories from version control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../Algorithms/TransferRandomForest.cs | 392 ------------------ worktrees/nf-001 | 1 - worktrees/us-ci-002 | 1 - worktrees/us-ci-003 | 1 - worktrees/us-nf-002 | 1 - worktrees/us-nf-003 | 1 - worktrees/us-nf-004 | 1 - 7 files changed, 398 deletions(-) delete mode 100644 .worktrees/us-if-001/src/TransferLearning/Algorithms/TransferRandomForest.cs delete mode 160000 worktrees/nf-001 delete mode 160000 worktrees/us-ci-002 delete mode 160000 worktrees/us-ci-003 delete mode 160000 worktrees/us-nf-002 delete mode 160000 worktrees/us-nf-003 delete mode 160000 worktrees/us-nf-004 diff --git a/.worktrees/us-if-001/src/TransferLearning/Algorithms/TransferRandomForest.cs b/.worktrees/us-if-001/src/TransferLearning/Algorithms/TransferRandomForest.cs deleted file mode 100644 index 4b4ea2c442..0000000000 --- a/.worktrees/us-if-001/src/TransferLearning/Algorithms/TransferRandomForest.cs +++ /dev/null @@ -1,392 +0,0 @@ -using System; -using System.Collections.Generic; -using AiDotNet.Interfaces; -using AiDotNet.Regression; -using AiDotNet.Models.Options; -using AiDotNet.Regularization; -using AiDotNet.TransferLearning.FeatureMapping; -using AiDotNet.Helpers; - -namespace AiDotNet.TransferLearning.Algorithms; - -/// -/// Implements transfer learning for Random Forest models. -/// -/// The numeric type used for calculations (e.g., double, float). -/// -/// -/// For Beginners: This class enables Random Forest models to transfer knowledge -/// from one domain to another. Random Forests are ensembles of decision trees, and this -/// class can adapt them when the source and target domains have different feature spaces. -/// -/// -public class TransferRandomForest : TransferLearningBase, Vector> -{ - private readonly RandomForestRegressionOptions _options; - private readonly IRegularization, Vector> _regularization; - - /// - /// Initializes a new instance of the TransferRandomForest class. - /// - /// Configuration options for the Random Forest. - /// Regularization to apply. - public TransferRandomForest( - RandomForestRegressionOptions options, - IRegularization, Vector>? regularization = null) - { - _options = options; - _regularization = regularization ?? new NoRegularization, Vector>(); - } - - /// - /// Transfers a Random Forest model to a target domain with the same feature space. - /// - protected override IFullModel, Vector> TransferSameDomain( - IFullModel, Vector> sourceModel, - Matrix targetData, - Vector targetLabels) - { - // Apply domain adaptation if available - Matrix adaptedData = targetData; - if (DomainAdapter != null) - { - // Get some source data for adaptation (would need to be passed in a full implementation) - // For now, we'll skip this step or use targetData as-is - adaptedData = targetData; - } - - // Fine-tune on target domain - var targetModel = new RandomForestRegression(_options, _regularization); - targetModel.Train(adaptedData, targetLabels); - - return targetModel; - } - - /// - /// Transfers a Random Forest model to a target domain with a different feature space. - /// - /// - /// NOTE: This implementation requires source domain data to properly train the feature mapper - /// and domain adapter. The current API limitations prevent passing source data, so this method - /// will throw NotImplementedException. Users should provide source data through the feature - /// mapper and domain adapter before calling transfer, or use the public Transfer() method - /// that accepts source data. - /// - protected override IFullModel, Vector> TransferCrossDomain( - IFullModel, Vector> sourceModel, - Matrix targetData, - Vector targetLabels) - { - throw new NotImplementedException( - "Cross-domain transfer requires source domain data for proper feature mapping and domain adaptation. " + - "The protected TransferCrossDomain method cannot access source data due to API limitations. " + - "Please use the public Transfer(sourceModel, sourceData, targetData, targetLabels) method instead, " + - "or pre-train the FeatureMapper and DomainAdapter with source data before calling this method."); - } - - /// - /// Transfers a Random Forest model to a target domain with proper source data. - /// - /// The model trained on the source domain. - /// Training data from the source domain (required for cross-domain transfer). - /// Training data from the target domain. - /// Labels for the target domain data. - /// A new model adapted to the target domain. - public IFullModel, Vector> Transfer( - IFullModel, Vector> sourceModel, - Matrix sourceData, - Matrix targetData, - Vector targetLabels) - { - // Determine if cross-domain transfer is needed - bool needsCrossDomain = RequiresCrossDomainTransfer(sourceModel, targetData); - - if (!needsCrossDomain) - { - return TransferSameDomain(sourceModel, targetData, targetLabels); - } - - // Cross-domain transfer with proper source data - if (FeatureMapper == null) - { - throw new InvalidOperationException( - "Cross-domain transfer requires a feature mapper. Use SetFeatureMapper() before transfer."); - } - - // Step 1: Train feature mapper with actual source and target data - if (!FeatureMapper.IsTrained) - { - FeatureMapper.Train(sourceData, targetData); - } - - // Step 2: Get source model's feature dimension - int sourceFeatures = sourceModel.GetActiveFeatureIndices().Count(); - - // Step 3: Map target features to source feature space - Matrix mappedTargetData = FeatureMapper.MapToSource(targetData, sourceFeatures); - - // Step 4: Apply domain adaptation if available - if (DomainAdapter != null && DomainAdapter.RequiresTraining) - { - // Train domain adapter with actual source and mapped target data - Matrix mappedSourceData = FeatureMapper.MapToSource(sourceData, sourceFeatures); - DomainAdapter.Train(mappedSourceData, mappedTargetData); - } - - if (DomainAdapter != null) - { - mappedTargetData = DomainAdapter.AdaptSource(mappedTargetData, targetData); - } - - // Step 5: Use source model for predictions on mapped data (knowledge distillation) - Vector pseudoLabels = sourceModel.Predict(mappedTargetData); - - // Step 6: Combine pseudo-labels with true labels (if available) - var combinedLabels = CombineLabels(pseudoLabels, targetLabels, 0.7); // 70% weight on true labels - - // Step 7: Train new model on target domain with combined labels - var targetModel = new RandomForestRegression(_options, _regularization); - targetModel.Train(targetData, combinedLabels); - - // Step 8: Wrap the model to handle feature mapping at prediction time - return new MappedRandomForestModel(targetModel, FeatureMapper, sourceFeatures); - } - - /// - /// Combines pseudo-labels from source model with true target labels. - /// - private Vector CombineLabels(Vector pseudoLabels, Vector trueLabels, double trueWeight) - { - var combined = new Vector(pseudoLabels.Length); - T trueW = NumOps.FromDouble(trueWeight); - T pseudoW = NumOps.FromDouble(1.0 - trueWeight); - - for (int i = 0; i < combined.Length; i++) - { - combined[i] = NumOps.Add( - NumOps.Multiply(trueW, trueLabels[i]), - NumOps.Multiply(pseudoW, pseudoLabels[i])); - } - - return combined; - } -} - -/// -/// Wrapper model that applies feature mapping before prediction. -/// -internal class MappedRandomForestModel : IFullModel, Vector> -{ - private const int WrapperMagic = 0x4D52464D; // 'MRFM' - private readonly IFullModel, Vector> _baseModel; - private readonly IFeatureMapper _mapper; - private readonly int _targetFeatures; - private readonly INumericOperations _numOps; - private static System.Reflection.MethodInfo? _inverseMapMethod; - - public MappedRandomForestModel( - IFullModel, Vector> baseModel, - IFeatureMapper mapper, - int targetFeatures) - { - _baseModel = baseModel; - _mapper = mapper; - _targetFeatures = targetFeatures; - _numOps = AiDotNet.Helpers.MathHelper.GetNumericOperations(); - // Initialize inverse-map reflection method once per process if available - _inverseMapMethod ??= _mapper.GetType().GetMethod("InverseMapFeatureName", new[] { typeof(string) }); - } - - public void Train(Matrix input, Vector expectedOutput) - { - _baseModel.Train(input, expectedOutput); - } - - public Vector Predict(Matrix input) - { - // Input might need to be mapped if it's from a different feature space - return _baseModel.Predict(input); - } - - public ModelMetaData GetModelMetaData() - { - return _baseModel.GetModelMetaData(); - } - - public byte[] Serialize() - { - using var ms = new MemoryStream(); - using var writer = new BinaryWriter(ms); - var baseBytes = _baseModel.Serialize(); - WriteWrapper(writer, baseBytes); - return ms.ToArray(); - } - - public void Deserialize(byte[] data) - { - using var ms = new MemoryStream(data); - using var reader = new BinaryReader(ms); - if (TryReadWrapper(reader, out var baseBytes)) - { - _baseModel.Deserialize(baseBytes); - return; - } - _baseModel.Deserialize(data); - } - - public IFullModel, Vector> WithParameters(Vector parameters) - { - return _baseModel.WithParameters(parameters); - } - - public Vector GetParameters() - { - return _baseModel.GetParameters(); - } - - public IEnumerable GetActiveFeatureIndices() - { - return _baseModel.GetActiveFeatureIndices(); - } - - public bool IsFeatureUsed(int featureIndex) - { - return _baseModel.IsFeatureUsed(featureIndex); - } - - public IFullModel, Vector> DeepCopy() - { - return new MappedRandomForestModel( - _baseModel.DeepCopy(), - _mapper, - _targetFeatures); - } - - public IFullModel, Vector> Clone() - { - return DeepCopy(); - } - - public virtual void SetParameters(Vector parameters) - { - _baseModel.SetParameters(parameters); - } - - public virtual int ParameterCount - { - get { return _baseModel.ParameterCount; } - } - - public virtual void SaveModel(string filePath) - { - // Persist wrapper metadata and base model bytes together - using var ms = new MemoryStream(); - using (var writer = new BinaryWriter(ms)) - { - var baseBytes = _baseModel.Serialize(); - WriteWrapper(writer, baseBytes); - } - var data = ms.ToArray(); - var directory = Path.GetDirectoryName(filePath); - if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) - { - Directory.CreateDirectory(directory); - } - File.WriteAllBytes(filePath, data); - } - - public virtual void LoadModel(string filePath) - { - if (!File.Exists(filePath)) - { - throw new FileNotFoundException($"The specified model file does not exist: {filePath}", filePath); - } - var data = File.ReadAllBytes(filePath); - using var ms = new MemoryStream(data); - using var reader = new BinaryReader(ms); - if (!TryReadWrapper(reader, out var baseBytes)) - { - throw new InvalidOperationException("Failed to deserialize MappedRandomForestModel wrapper format. The file may be corrupted or in an incompatible format."); - } - _baseModel.Deserialize(baseBytes); - } - - public virtual Dictionary GetFeatureImportance() - { - var baseImportance = _baseModel.GetFeatureImportance(); - var mappedImportance = new Dictionary(baseImportance.Count); - var mapMethod = _inverseMapMethod; - foreach (var kvp in baseImportance) - { - var key = kvp.Key; - if (mapMethod != null) - { - try - { - var mappedKey = mapMethod.Invoke(_mapper, new object[] { kvp.Key }); - if (mappedKey is string s) - { - key = s; - } - } - catch (Exception ex) - { - // Failed to inverse map feature name; using original key as fallback - } - } - mappedImportance[key] = kvp.Value; - } - return mappedImportance; - } - - private void WriteWrapper(BinaryWriter writer, byte[] baseBytes) - { - writer.Write(WrapperMagic); - writer.Write(_targetFeatures); - try - { - writer.Write(Convert.ToDouble(_mapper.GetMappingConfidence())); - } - catch (Exception ex) - { - // Failed to write mapping confidence, fallback to 0.0 - writer.Write(0.0); - } - writer.Write(baseBytes.Length); - writer.Write(baseBytes); - writer.Flush(); - } - - private bool TryReadWrapper(BinaryReader reader, out byte[] baseBytes) - { - try - { - var magic = reader.ReadInt32(); - if (magic != WrapperMagic) - { - baseBytes = Array.Empty(); - return false; - } - var target = reader.ReadInt32(); - if (target != _targetFeatures) - { - throw new InvalidOperationException($"Deserialized target feature count ({target}) does not match current instance ({_targetFeatures})."); - } - var confidence = reader.ReadDouble(); // Read mapping confidence (currently unused; read to maintain stream compatibility, reserved for future validation/versioning) - var len = reader.ReadInt32(); - baseBytes = reader.ReadBytes(len); - return true; - } - catch (Exception ex) - { - // Failed to read wrapper format; fallback for backward compatibility with non-wrapped models - baseBytes = Array.Empty(); - return false; - } - } - - public virtual void SetActiveFeatureIndices(IEnumerable featureIndices) - { - _baseModel.SetActiveFeatureIndices(featureIndices); - } -} diff --git a/worktrees/nf-001 b/worktrees/nf-001 deleted file mode 160000 index 525d7954c0..0000000000 --- a/worktrees/nf-001 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 525d7954c01f51aec10e097f6942c5ca057ce404 diff --git a/worktrees/us-ci-002 b/worktrees/us-ci-002 deleted file mode 160000 index a62d5b2b10..0000000000 --- a/worktrees/us-ci-002 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a62d5b2b107a75c726ee7503dc7236d999dc8fe2 diff --git a/worktrees/us-ci-003 b/worktrees/us-ci-003 deleted file mode 160000 index 19cc7e179f..0000000000 --- a/worktrees/us-ci-003 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 19cc7e179f1e354047d29cd1cfd1f532945312a0 diff --git a/worktrees/us-nf-002 b/worktrees/us-nf-002 deleted file mode 160000 index 52d00507dc..0000000000 --- a/worktrees/us-nf-002 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52d00507dc3921d70465837abb8175a59b87bbba diff --git a/worktrees/us-nf-003 b/worktrees/us-nf-003 deleted file mode 160000 index 17023382ef..0000000000 --- a/worktrees/us-nf-003 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 17023382ef37b3158392410471798631b6a39541 diff --git a/worktrees/us-nf-004 b/worktrees/us-nf-004 deleted file mode 160000 index c1fdb0cb80..0000000000 --- a/worktrees/us-nf-004 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1fdb0cb8051820d00dfa92bc6f304ded0341749 From e46dfdf49f30425156890d4caf046a99fdd9a9b0 Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Thu, 23 Oct 2025 00:48:42 -0400 Subject: [PATCH 4/6] fix(us-if-008): address copilot review comments on xml documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Simplify Kernel property summary to avoid duplication with remarks - Fix line breaks in XML documentation to keep complete sentences together - Improve overall documentation formatting for better readability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Models/Options/BayesianOptimizerOptions.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Models/Options/BayesianOptimizerOptions.cs b/src/Models/Options/BayesianOptimizerOptions.cs index d7b1604051..a2d395086f 100644 --- a/src/Models/Options/BayesianOptimizerOptions.cs +++ b/src/Models/Options/BayesianOptimizerOptions.cs @@ -120,20 +120,18 @@ public class BayesianOptimizerOptions : OptimizationAlgorith public AcquisitionFunctionType AcquisitionFunction { get; set; } = AcquisitionFunctionType.UpperConfidenceBound; /// - /// Gets or sets the kernel function used by the Gaussian Process model for measuring similarity between points. + /// Gets or sets the kernel function used by the Gaussian Process model. /// /// The kernel function, defaulting to Gaussian kernel (also known as Radial Basis Function kernel). /// /// - /// The kernel function determines how the algorithm measures similarity between points in the search space, - /// which affects how it generalizes from observed data points to unobserved points. Different kernel functions - /// can be used depending on the expected structure of the objective function. + /// The kernel function determines how the algorithm measures similarity between points in the search space, which affects how it generalizes from observed data points to unobserved points. + /// Different kernel functions can be used depending on the expected structure of the objective function. /// - /// For Beginners: The kernel function helps the algorithm understand how similar different points are - /// to each other. The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will - /// have similar values, with the similarity decreasing smoothly as distance increases. This is like assuming that in - /// our hilly landscape, nearby locations tend to have similar heights. The Gaussian kernel works well for many problems, - /// especially when the underlying function is smooth. + /// For Beginners: The kernel function helps the algorithm understand how similar different points are to each other. + /// The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will have similar values, with the similarity decreasing smoothly as distance increases. + /// This is like assuming that in our hilly landscape, nearby locations tend to have similar heights. + /// The Gaussian kernel works well for many problems, especially when the underlying function is smooth. /// public IKernelFunction Kernel { get; set; } = new GaussianKernel(); From a9ee20791971b506d35bf862e9f516c26d78c4cf Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Thu, 23 Oct 2025 02:27:05 -0400 Subject: [PATCH 5/6] fix(us-if-008): remove returns tag from method that always throws MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove inappropriate tag from Forward(Tensor) method as it never returns a value - it always throws NotSupportedException. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/NeuralNetworks/Layers/DecoderLayer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NeuralNetworks/Layers/DecoderLayer.cs b/src/NeuralNetworks/Layers/DecoderLayer.cs index 02444cb986..3cd1cf0eda 100644 --- a/src/NeuralNetworks/Layers/DecoderLayer.cs +++ b/src/NeuralNetworks/Layers/DecoderLayer.cs @@ -372,7 +372,6 @@ public override void ResetState() /// Single-input forward pass is not supported for DecoderLayer. /// /// The input tensor. - /// Not applicable - this method always throws an exception. /// Always thrown because DecoderLayer requires multiple inputs. /// /// For Beginners: DecoderLayer cannot operate with a single input because it needs both From 22fabfd2296a5721040b4a9a2cdc8a933fd57b40 Mon Sep 17 00:00:00 2001 From: Franklin Moormann Date: Thu, 23 Oct 2025 08:18:32 -0400 Subject: [PATCH 6/6] docs: add comprehensive XML documentation for Kernel property --- src/Models/Options/BayesianOptimizerOptions.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Models/Options/BayesianOptimizerOptions.cs b/src/Models/Options/BayesianOptimizerOptions.cs index a2d395086f..72bc4e3e6b 100644 --- a/src/Models/Options/BayesianOptimizerOptions.cs +++ b/src/Models/Options/BayesianOptimizerOptions.cs @@ -125,13 +125,14 @@ public class BayesianOptimizerOptions : OptimizationAlgorith /// The kernel function, defaulting to Gaussian kernel (also known as Radial Basis Function kernel). /// /// - /// The kernel function determines how the algorithm measures similarity between points in the search space, which affects how it generalizes from observed data points to unobserved points. - /// Different kernel functions can be used depending on the expected structure of the objective function. + /// The kernel function determines how the algorithm measures similarity between points in the search space, + /// which affects how it generalizes from observed data points to unobserved points. /// - /// For Beginners: The kernel function helps the algorithm understand how similar different points are to each other. - /// The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will have similar values, with the similarity decreasing smoothly as distance increases. - /// This is like assuming that in our hilly landscape, nearby locations tend to have similar heights. - /// The Gaussian kernel works well for many problems, especially when the underlying function is smooth. + /// For Beginners: The kernel function helps the algorithm understand how similar different points are + /// to each other. The default Gaussian kernel (also called Radial Basis Function kernel) assumes that points close to each other will + /// have similar values, with the similarity decreasing smoothly as distance increases. This is like assuming that in + /// our hilly landscape, nearby locations tend to have similar heights. The Gaussian kernel works well for many problems, + /// especially when the underlying function is smooth. /// public IKernelFunction Kernel { get; set; } = new GaussianKernel();