SecML
v0.10

User Guide

  • 1. Training of Classifiers and Visualization of Results
  • 2. Evasion Attacks against Machine Learning models
  • 3. Transferability of Evasion Attacks
  • 4. Poisoning Attacks against Machine Learning models
  • 5. Evasion and Poisoning Attacks on MNIST dataset
  • 6. Neural Networks with PyTorch
  • 7. Evasion Attacks against Neural Networks on MNIST dataset
  • 8. Evasion Attacks on ImageNet dataset
  • 9. Explaining Machine Learning

Core & Data Structures

  • secml.core
    • CCreator
    • attr_utils
    • constants
    • decorators
    • exceptions
    • type_utils
  • secml.array
    • CArray
    • array_utils
  • secml.data
    • secml.data.loader
      • CDataLoader
      • CDataLoaderCIFAR
      • CDataLoaderICubWorld
      • CDataLoaderImgClients
      • CDataLoaderImgFolders
      • CDataLoaderLFW
      • CDataLoaderMNIST
      • CDataLoaderPyTorch
      • CDataLoaderSkLearn
      • CDataLoaderSvmLight
      • CDataLoaderTorchDataset
      • loader_utils
    • secml.data.selection
      • CPrototypesSelector
      • CPSBorder
      • CPSCenter
      • CPSKMedians
      • CPSRandom
      • CPSSpanning
    • secml.data.splitter
      • CDataSplitter
      • CDataSplitterKFold
      • CDataSplitterLabelKFold
      • CDataSplitterOpenWorldKFold
      • CDataSplitterShuffle
      • CDataSplitterStratifiedKFold
      • CTrainTestSplit
      • CChronologicalSplitter
    • CDataset
    • CDatasetHeader
    • CDatasetPyTorch
    • data_utils

Machine Learning

  • secml.ml
    • secml.ml.classifiers
      • secml.ml.classifiers.multiclass
        • CClassifierMulticlass
        • CClassifierMulticlassOVA
      • secml.ml.classifiers.reject
        • CClassifierReject
        • CClassifierRejectThreshold
      • secml.ml.classifiers.loss
        • CLoss
        • CLossCrossEntropy
        • CLossEpsilonInsensitive
        • CLossHinge
        • CLossLogistic
        • CLossSquare
        • CSoftmax
      • secml.ml.classifiers.regularizer
        • CRegularizer
        • CRegularizerElasticNet
        • CRegularizerL1
        • CRegularizerL2
      • CClassifier
      • CClassifierLinear
      • CClassifierSkLearn
      • CClassifierDecisionTree
      • CClassifierKNN
      • CClassifierLogistic
      • CClassifierNearestCentroid
      • CClassifierRandomForest
      • CClassifierRidge
      • CClassifierSGD
      • CClassifierSVM
      • CClassifierPyTorch
      • CModelCleverhans
      • clf_utils
    • secml.ml.features
      • secml.ml.features.normalization
        • CNormalizer
        • CNormalizerLinear
        • CNormalizerMeanStd
        • CNormalizerMinMax
        • CNormalizerUnitNorm
        • CNormalizerDNN
      • secml.ml.features.reduction
        • CReducer
        • CLDA
        • CPCA
      • CPreProcess
    • secml.ml.kernel
      • CKernel
      • CKernelChebyshevDistance
      • CKernelEuclidean
      • CKernelHistIntersect
      • CKernelLaplacian
      • CKernelLinear
      • CKernelPoly
      • CKernelRBF
    • secml.ml.peval
      • secml.ml.peval.metrics
        • CMetric
        • CMetricAccuracy
        • CMetricAUC
        • CMetricAUCWMW
        • CMetricConfusionMatrix
        • CMetricF1
        • CMetricMAE
        • CMetricMSE
        • CMetricPartialAUC
        • CMetricPrecision
        • CMetricRecall
        • CRoc
        • CMetricTestError
        • CMetricTPRatFPR
      • CPerfEvaluator
      • CPerfEvaluatorXVal
      • CPerfEvaluatorXValMulticlass
    • secml.ml.stats
      • CDensityEstimation
      • CDistributionGaussian
  • secml.adv
    • secml.adv.attacks
      • secml.adv.attacks.evasion
        • CAttackEvasion
        • CAttackEvasionPGD
        • CAttackEvasionPGDLS
        • CAttackEvasionCleverhans
      • secml.adv.attacks.poisoning
        • CAttackPoisoning
        • CAttackPoisoningLogisticRegression
        • CAttackPoisoningRidge
        • CAttackPoisoningSVM
      • CAttack
    • secml.adv.seceval
      • CSecEval
      • CSecEvalData
  • secml.optim
    • secml.optim.function
      • CFunction
      • CFunctionLinear
      • CFunctionQuadratic
      • CFunctionRosenbrock
      • CFunctionThreeHumpCamel
      • CFunctionBeale
      • CFunctionMcCormick
    • secml.optim.optimizers
      • secml.optim.optimizers.line_search
        • CLineSearch
        • CLineSearchBisect
      • COptimizer
      • COptimizerPGDLS
      • COptimizerPGD
      • COptimizerScipy
    • secml.optim.constraints
      • CConstraint
      • CConstraintBox
      • CConstraintL1
      • CConstraintL2

Explanation

  • secml.explanation
    • CExplainer
    • CExplainerGradient
    • CExplainerGradientInput
    • CExplainerIntegratedGradients
    • CExplainerInfluenceFunctions

Visualization

  • secml.figure
    • CFigure
    • CPlot

Utilities

  • secml.parallel
    • parfor
  • secml.utils
    • CLog
    • c_file_manager
    • pickle_utils
    • download_utils
    • dict_utils
    • list_utils
    • mixed_utils
  • secml.settings
  • secml.testing
    • CUnitTest

References

  • UPDATE GUIDES
    • From 0.8.* to 0.9
      • 1. Configuration file
      • 2. Deprecations
  • CHANGELOG
    • v0.10 (29/10/2019)
      • Requirements (1 change)
      • Added (4 changes)
      • Improved (6 changes)
      • Changed (4 changes)
      • Fixed (4 changes)
      • Removed & Deprecated (5 changes)
      • Documentation (5 changes)
    • v0.9 (11/10/2019)
      • Improved (1 change)
      • Changed (1 change)
      • Fixed (1 change)
      • Documentation (2 changes)
      • Deprecations (3 changes)
    • v0.8.1 (05/09/2019)
      • Documentation (2 changes)
    • v0.8 (06/08/2019)
  • ROADMAP
SecML
  • Docs »
  • secml.optim »
  • secml.optim.optimizers »
  • secml.optim.optimizers.line_search
  • Edit on GitLab

secml.optim.optimizers.line_search¶

CLineSearch¶

class secml.optim.optimizers.line_search.c_line_search.CLineSearch(fun, constr=None, bounds=None, eta=0.0001, max_iter=20)[source]¶

Bases: secml.core.c_creator.CCreator

Abstract class that implements line-search optimization algorithms.

Line-search algorithms optimize the objective function along a given direction in the feasible domain, potentially subject to constraints. The search is normally stopped when the objective improves at a satisfying level, to keep the search fast.

Attributes
class_type

Defines class type.

logger

Logger for current object.

verbose

Verbosity level of logger output.

Methods

copy(self)

Returns a shallow copy of current class.

create([class_item])

This method creates an instance of a class with given type.

deepcopy(self)

Returns a deep copy of current class.

get_class_from_type(class_type)

Return the class associated with input type.

get_params(self)

Returns the dictionary of class parameters.

get_subclasses()

Get all the subclasses of the calling class.

list_class_types()

This method lists all types of available subclasses of calling one.

load(path)

Loads class from pickle object.

minimize(self, x, d, \*\*kwargs)

Line search.

save(self, path)

Save class object using pickle.

set(self, param_name, param_value[, copy])

Set a parameter that has a specific name to a specific value.

set_params(self, params_dict[, copy])

Set all parameters passed as a dictionary {key: value}.

timed([msg])

Timer decorator.

abstract minimize(self, x, d, **kwargs)[source]¶

Line search.

Parameters
xCArray

The input point.

dCArray

The descent direction along which fun(x) is minimized.

kwargsdict

Additional parameters required to evaluate fun(x, **kwargs).

CLineSearchBisect¶

class secml.optim.optimizers.line_search.c_line_search_bisect.CLineSearchBisect(fun, constr=None, bounds=None, eta=0.0001, eta_min=0.1, eta_max=None, max_iter=20)[source]¶

Bases: secml.optim.optimizers.line_search.c_line_search.CLineSearch

Binary line search.

Attributes
class_type‘bisect’

Defines class type.

Methods

copy(self)

Returns a shallow copy of current class.

create([class_item])

This method creates an instance of a class with given type.

deepcopy(self)

Returns a deep copy of current class.

get_class_from_type(class_type)

Return the class associated with input type.

get_params(self)

Returns the dictionary of class parameters.

get_subclasses()

Get all the subclasses of the calling class.

list_class_types()

This method lists all types of available subclasses of calling one.

load(path)

Loads class from pickle object.

minimize(self, x, d[, fx, tol])

Bisect line search (on discrete grid).

save(self, path)

Save class object using pickle.

set(self, param_name, param_value[, copy])

Set a parameter that has a specific name to a specific value.

set_params(self, params_dict[, copy])

Set all parameters passed as a dictionary {key: value}.

timed([msg])

Timer decorator.

property eta_max¶
property eta_min¶
minimize(self, x, d, fx=None, tol=0.0001, **kwargs)[source]¶

Bisect line search (on discrete grid).

The function fun( x + a*eta*d ) with a = {0, 1, 2, … } is minimized along the descent direction d.

If fun(x) >= 0 -> step_min = step else step_max = step

If eta_max is not None, it runs a bisect line search in [x + eta_min*d, x + eta_max*d]; otherwise, it runs an exponential line search in `[x + eta*d, …, x + eta_min*d, …]

Parameters
xCArray

The input point.

dCArray

The descent direction along which fun(x) is minimized.

fxint or float or None, optional

The current value of fun(x) (if available).

tolfloat, optional

Tolerance for convergence to the local minimum.

kwargsdict

Additional parameters required to evaluate fun(x, **kwargs).

Returns
x’CArray

Point x’ = x + eta * d that approximately solves min f(x + eta*d).

fx’: int or float or None, optional

The value f(x’).

property n_iter¶
Next Previous

© Copyright 2019, PRALab - Pattern Recognition and Applications Lab & Pluribus One s.r.l. Revision f99cf9ba.

Built with Sphinx using a theme provided by Read the Docs.