Skip to content

Add SoftKNNClassifierModel (#5072)#5072

Open
sunnyshen321 wants to merge 1 commit into
facebook:mainfrom
sunnyshen321:export-D90894389
Open

Add SoftKNNClassifierModel (#5072)#5072
sunnyshen321 wants to merge 1 commit into
facebook:mainfrom
sunnyshen321:export-D90894389

Conversation

@sunnyshen321
Copy link
Copy Markdown

@sunnyshen321 sunnyshen321 commented Mar 19, 2026

Summary:

X-link: meta-pytorch/botorch#3243

Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
P(y=1|x) = sum(w_i * y_i) / sum(w_i)
where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 19, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Mar 19, 2026

@sunnyshen321 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90894389.

sunnyshen321 pushed a commit to sunnyshen321/botorch that referenced this pull request Mar 19, 2026
Summary:
X-link: facebook/Ax#5072


Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
@meta-codesync meta-codesync Bot changed the title Add SoftKNNClassifierModel Add SoftKNNClassifierModel (#5072) Mar 19, 2026
sunnyshen321 pushed a commit to sunnyshen321/Ax that referenced this pull request Mar 19, 2026
Summary:

X-link: meta-pytorch/botorch#3243

Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
sunnyshen321 pushed a commit to sunnyshen321/Ax that referenced this pull request Mar 19, 2026
Summary:

X-link: meta-pytorch/botorch#3243

Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
sunnyshen321 pushed a commit to sunnyshen321/botorch that referenced this pull request Mar 19, 2026
Summary:
X-link: facebook/Ax#5072


Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
sunnyshen321 pushed a commit to sunnyshen321/Ax that referenced this pull request Mar 19, 2026
Summary:

X-link: meta-pytorch/botorch#3243

Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
Summary:

X-link: meta-pytorch/botorch#3243

Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
sunnyshen321 pushed a commit to sunnyshen321/botorch that referenced this pull request Mar 19, 2026
Summary:
X-link: facebook/Ax#5072


Add a differentiable Soft K-Nearest Neighbors classifier model for failure-aware
Bayesian optimization. Unlike tree-based classifiers (RF, XGBoost), SoftKNN is
fully differentiable, enabling gradient-based acquisition function optimization.

The model uses Gaussian kernel weights:
  P(y=1|x) = sum(w_i * y_i) / sum(w_i)
  where w_i = exp(-||x - x_i||^2 / (2 * sigma^2))

Implements construct_inputs classmethod for seamless Ax integration.

Differential Revision: D90894389
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Jun 6, 2026

Hi @sunnyshen321!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant