pystruct.learners.
FrankWolfeSSVM
(model, max_iter=1000, C=1.0, verbose=0, n_jobs=1, show_loss_every=0, logger=None, batch_mode=False, line_search=True, check_dual_every=10, tol=0.001, do_averaging=True, sample_method='perm', random_state=None)[source]¶Structured SVM solver using Block-coordinate Frank-Wolfe.
This implementation is somewhat experimental. Use with care.
Parameters: | model : StructuredModel
max_iter : int, default=1000
C : float, default=1
verbose : int
n_jobs : int, default=1
show_loss_every : int, default=0
tol : float, default=1e-3
logger : logger object, default=None
batch_mode : boolean, default=False
line_search : boolean, default=True
check_dual_every : int, default=10
do_averaging : bool, default=True
random_state : int, RandomState instance or None, optional (default=None)
|
---|---|
Attributes: | w : nd-array, shape=(model.size_joint_feature,)
``loss_curve_`` : list of float
``objective_curve_`` : list of float
``primal_objective_curve_`` : list of float
``timestamps_`` : list of int
|
References
Block-Coordinage Frank-Wolfe Optimization for Structural SVMs,xi JMLR 2013
With batch_mode=False, this implements the online (block-coordinate) version of the algorithm (BCFW) BCFW is an attractive alternative to subgradient methods, as no learning rate is needed and a duality gap guarantee is given.
Methods
fit (X, Y[, constraints, initialize]) |
Learn parameters using (block-coordinate) Frank-Wolfe learning. |
get_params ([deep]) |
Get parameters for this estimator. |
predict (X) |
Predict output on examples in X. |
score (X, Y) |
Compute score as 1 - loss over whole data set. |
set_params (**params) |
Set the parameters of this estimator. |
__init__
(model, max_iter=1000, C=1.0, verbose=0, n_jobs=1, show_loss_every=0, logger=None, batch_mode=False, line_search=True, check_dual_every=10, tol=0.001, do_averaging=True, sample_method='perm', random_state=None)[source]¶fit
(X, Y, constraints=None, initialize=True)[source]¶Learn parameters using (block-coordinate) Frank-Wolfe learning.
Parameters: | X : iterable
Y : iterable
contraints : ignored initialize : boolean, default=True
|
---|
get_params
(deep=True)¶Get parameters for this estimator.
Parameters: | deep: boolean, optional :
|
---|---|
Returns: | params : mapping of string to any
|
predict
(X)¶Predict output on examples in X.
Parameters: | X : iterable
|
---|---|
Returns: | Y_pred : list
|
score
(X, Y)¶Compute score as 1 - loss over whole data set.
Returns the average accuracy (in terms of model.loss) over X and Y.
Parameters: | X : iterable
Y : iterable
|
---|---|
Returns: | score : float
|
set_params
(**params)¶Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
<component>__<parameter>
so that it’s possible to update each
component of a nested object.
Returns: | self : |
---|