Lines Matching full:current
151 const FunctionSample& current,
154 if (!current.value_is_valid ||
156 max_step_size <= current.x)) {
159 return min(max(current.x * 0.5, min_step_size), max_step_size);
161 CHECK_GT(max_step_size, current.x);
170 // to avoid replicating current.value_is_valid == false
177 << ", current: " << current;
187 samples.push_back(ValueSample(current.x, current.value));
196 samples.push_back(current);
237 FunctionSample current = ValueAndGradientSample(step_size_estimate, 0.0, 0.0);
238 current.value_is_valid = false;
247 current.value_is_valid =
248 function->Evaluate(current.x,
249 ¤t.value,
251 ? ¤t.gradient : NULL);
252 current.gradient_is_valid =
253 interpolation_uses_gradients && current.value_is_valid;
254 while (!current.value_is_valid ||
255 current.value > (initial_cost
258 * current.x)) {
259 // If current.value_is_valid is false, we treat it as if the cost at that
277 current,
278 (options().max_step_contraction * current.x),
279 (options().min_step_contraction * current.x));
290 previous = current;
291 current.x = step_size;
295 current.value_is_valid =
296 function->Evaluate(current.x,
297 ¤t.value,
299 ? ¤t.gradient : NULL);
300 current.gradient_is_valid =
301 interpolation_uses_gradients && current.value_is_valid;
304 summary->optimal_step_size = current.x;
437 FunctionSample current = ValueAndGradientSample(step_size_estimate, 0.0, 0.0);
438 current.value_is_valid = false;
450 current.value_is_valid =
451 function->Evaluate(current.x,
452 ¤t.value,
454 ? ¤t.gradient : NULL);
455 current.gradient_is_valid =
456 interpolation_uses_gradients && current.value_is_valid;
461 if (current.value_is_valid &&
462 (current.value > (initial_position.value
465 * current.x) ||
466 (previous.value_is_valid && current.value > previous.value))) {
467 // Bracket found: current step size violates Armijo sufficient decrease
472 *bracket_high = current;
477 // gradient at the current point (which satisfies the Armijo condition)
482 current.value_is_valid =
483 function->Evaluate(current.x,
484 ¤t.value,
485 ¤t.gradient);
486 current.gradient_is_valid = current.value_is_valid;
489 if (current.value_is_valid &&
490 fabs(current.gradient) <=
492 // Current step size satisfies the strong Wolfe conditions, and is thus a
494 *bracket_low = current;
495 *bracket_high = current;
498 } else if (current.value_is_valid && current.gradient >= 0) {
499 // Bracket found: current step size has stepped past an inflection point
501 // f(current) is our best minimum thus far. Remember step size
503 // even though f(previous) > f(current).
506 *bracket_low = current;
524 current.value_is_valid && current.value < bracket_low->value
525 ? current : *bracket_low;
528 // Either: f(current) is invalid; or, f(current) is valid, but does not
532 // If f(current) is valid, (but meets no criteria) expand the search by
535 current.value_is_valid
536 ? (current.x * options().max_step_expansion) : current.x;
544 // Contracts step size if f(current) is not valid.
550 current,
562 previous = current.value_is_valid ? current : previous;
563 current.x = step_size;
567 current.value_is_valid =
568 function->Evaluate(current.x,
569 ¤t.value,
571 ? ¤t.gradient : NULL);
572 current.gradient_is_valid =
573 interpolation_uses_gradients && current.value_is_valid;
698 // than current lowest sample, use as new upper bound.
706 // gradient at the current point (which satisfies the Armijo condition)