Commit 3757fc73 authored by Davis King's avatar Davis King

Made the order of constructor arguments in the various overloads

for the assignment_function and sequence_labeler consistent.
parent 890d4e53
......@@ -54,8 +54,8 @@ namespace dlib
}
assignment_function(
const feature_extractor& fe_,
const matrix<double,0,1>& weights_
const matrix<double,0,1>& weights_,
const feature_extractor& fe_
) :
fe(fe_),
weights(weights_),
......@@ -63,7 +63,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_ASSERT(fe_.num_features() == static_cast<unsigned long>(weights_.size()),
"\t assignment_function::assignment_function(fe_,weights_)"
"\t assignment_function::assignment_function(weights_,fe_)"
<< "\n\t These sizes should match"
<< "\n\t fe_.num_features(): " << fe_.num_features()
<< "\n\t weights_.size(): " << weights_.size()
......@@ -72,8 +72,8 @@ namespace dlib
}
assignment_function(
const feature_extractor& fe_,
const matrix<double,0,1>& weights_,
const feature_extractor& fe_,
bool force_assignment_
) :
fe(fe_),
......@@ -82,7 +82,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_ASSERT(fe_.num_features() == static_cast<unsigned long>(weights_.size()),
"\t assignment_function::assignment_function(fe_,weights_,force_assignment_)"
"\t assignment_function::assignment_function(weights_,fe_,force_assignment_)"
<< "\n\t These sizes should match"
<< "\n\t fe_.num_features(): " << fe_.num_features()
<< "\n\t weights_.size(): " << weights_.size()
......@@ -209,7 +209,7 @@ namespace dlib
deserialize(weights, in);
deserialize(force_assignment, in);
item = assignment_function<feature_extractor>(fe, weights, force_assignment);
item = assignment_function<feature_extractor>(weights, fe, force_assignment);
}
// ----------------------------------------------------------------------------------------
......
......@@ -161,8 +161,8 @@ namespace dlib
!*/
assignment_function(
const feature_extractor& fe,
const matrix<double,0,1>& weights
const matrix<double,0,1>& weights,
const feature_extractor& fe
);
/*!
requires
......@@ -174,8 +174,8 @@ namespace dlib
!*/
assignment_function(
const feature_extractor& fe,
const matrix<double,0,1>& weights,
const feature_extractor& fe,
bool force_assignment
);
/*!
......
......@@ -202,15 +202,15 @@ namespace dlib
}
sequence_labeler(
const feature_extractor& fe_,
const matrix<double,0,1>& weights_
const matrix<double,0,1>& weights_,
const feature_extractor& fe_
) :
fe(fe_),
weights(weights_)
{
// make sure requires clause is not broken
DLIB_ASSERT(fe_.num_features() == static_cast<unsigned long>(weights_.size()),
"\t sequence_labeler::sequence_labeler(fe_,weights_)"
"\t sequence_labeler::sequence_labeler(weights_,fe_)"
<< "\n\t These sizes should match"
<< "\n\t fe_.num_features(): " << fe_.num_features()
<< "\n\t weights_.size(): " << weights_.size()
......@@ -294,7 +294,7 @@ namespace dlib
deserialize(fe, in);
deserialize(weights, in);
item = sequence_labeler<feature_extractor>(fe, weights);
item = sequence_labeler<feature_extractor>(weights, fe);
}
// ----------------------------------------------------------------------------------------
......
......@@ -221,8 +221,8 @@ namespace dlib
!*/
sequence_labeler(
const feature_extractor& fe,
const matrix<double,0,1>& weights
const matrix<double,0,1>& weights,
const feature_extractor& fe
);
/*!
requires
......
......@@ -185,7 +185,7 @@ namespace dlib
solver(prob, weights);
return assignment_function<feature_extractor>(fe,weights,force_assignment);
return assignment_function<feature_extractor>(weights,fe,force_assignment);
}
......
......@@ -182,7 +182,7 @@ namespace dlib
prob.set_max_cache_size(max_cache_size);
solver(prob, weights);
return sequence_labeler<feature_extractor>(fe,weights);
return sequence_labeler<feature_extractor>(weights,fe);
}
private:
......
......@@ -57,7 +57,7 @@ namespace dlib
given labels. In particular, it attempts to learn to predict labels[i]
based on samples[i]. Or in other words, this object can be used to learn
a parameter vector, w, such that an assignment_function declared as:
assignment_function<feature_extractor> assigner(fe,w,force_assignment)
assignment_function<feature_extractor> assigner(w,fe,force_assignment)
results in an assigner object which attempts to compute the following mapping:
labels[i] == labeler(samples[i])
- This object will use num_threads threads during the optimization
......
......@@ -57,7 +57,7 @@ namespace dlib
given labels. In particular, it attempts to learn to predict labels[i]
based on samples[i]. Or in other words, this object can be used to learn
a parameter vector, w, such that a sequence_labeler declared as:
sequence_labeler<feature_extractor> labeler(fe,w)
sequence_labeler<feature_extractor> labeler(w,fe)
results in a labeler object which attempts to compute the following mapping:
labels[i] == labeler(samples[i])
- This object will use num_threads threads during the optimization
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment