Package jdistlib.inference
Class AcceleratedLogisticRegression
java.lang.Object
jdistlib.inference.AcceleratedLogisticRegression
- All Implemented Interfaces:
AutoCloseable,BatchedDifferentiableLogDensity,ComputeBackedLogDensity,DifferentiableLogDensity,LogDensity
public final class AcceleratedLogisticRegression
extends Object
implements BatchedDifferentiableLogDensity, ComputeBackedLogDensity, AutoCloseable
Device-resident batched logistic-regression posterior with a spherical normal prior.
-
Constructor Summary
ConstructorsConstructorDescriptionAcceleratedLogisticRegression(ComputeBackend backend, double[][] design, double[] outcomes, double priorPrecision) -
Method Summary
Modifier and TypeMethodDescriptionbackend()voidclose()Selects a backend directly for vectorized or regular many-chain workflows.intforNuts(SamplingOptions options, double[][] design, double[] outcomes, double priorPrecision) Selects the backend from general sampling options for a NUTS workflow.doublelogDensityAndGradient(double[] state, double[] gradient) Evaluates the log density and replacesgradientwith its gradient.voidlogDensityAndGradientBatch(double[][] states, double[] logDensities, double[][] gradients) Replaces every output row; implementations may execute the batch concurrently.introws()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jdistlib.inference.DifferentiableLogDensity
logDensity
-
Constructor Details
-
AcceleratedLogisticRegression
public AcceleratedLogisticRegression(ComputeBackend backend, double[][] design, double[] outcomes, double priorPrecision)
-
-
Method Details
-
forNuts
public static AcceleratedLogisticRegression forNuts(SamplingOptions options, double[][] design, double[] outcomes, double priorPrecision) Selects the backend from general sampling options for a NUTS workflow. -
create
public static AcceleratedLogisticRegression create(Compute policy, double[][] design, double[] outcomes, double priorPrecision) Selects a backend directly for vectorized or regular many-chain workflows. -
logDensityAndGradient
public double logDensityAndGradient(double[] state, double[] gradient) Description copied from interface:DifferentiableLogDensityEvaluates the log density and replacesgradientwith its gradient.- Specified by:
logDensityAndGradientin interfaceDifferentiableLogDensity
-
logDensityAndGradientBatch
public void logDensityAndGradientBatch(double[][] states, double[] logDensities, double[][] gradients) Description copied from interface:BatchedDifferentiableLogDensityReplaces every output row; implementations may execute the batch concurrently.- Specified by:
logDensityAndGradientBatchin interfaceBatchedDifferentiableLogDensity
-
backend
-
computeBackend
- Specified by:
computeBackendin interfaceComputeBackedLogDensity
-
rows
public int rows() -
dimensions
public int dimensions() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-