tf.contrib.constrained_optimization.find_best_candidate_distribution
Stay organized with collections
Save and categorize content based on your preferences.
Finds a distribution minimizing an objective subject to constraints.
tf.contrib.constrained_optimization.find_best_candidate_distribution(
objective_vector, constraints_matrix, epsilon=0.0
)
This function deals with the constrained problem:
minimize f(w)
s.t. g_i(w) <= 0 for all i in {0,1,...,m-1}
Here, f(w) is the "objective function", and g_i(w) is the ith (of m)
"constraint function". Given a set of n "candidate solutions"
{w_0,w1,...,w{n-1} }, this function finds a distribution over these n
candidates that, in expectation, minimizes the objective while violating
the constraints by the smallest possible amount (with the amount being found
via bisection search).
The objective_vector
parameter should be a numpy array with shape (n,), for
which objective_vector[i] = f(w_i). Likewise, constraints_matrix
should be a
numpy array with shape (m,n), for which constraints_matrix[i,j] = g_i(w_j).
This function will return a distribution for which at most m+1 probabilities,
and often fewer, are nonzero.
For more specifics, please refer to:
Cotter, Jiang and Sridharan. "Two-Player Games for Efficient Non-Convex
Constrained Optimization".
https://arxiv.org/abs/1804.06500
This function implements the approach described in Lemma 3.
Args |
objective_vector
|
numpy array of shape (n,), where n is the number of
"candidate solutions". Contains the objective function values.
|
constraints_matrix
|
numpy array of shape (m,n), where m is the number of
constraints and n is the number of "candidate solutions". Contains the
constraint violation magnitudes.
|
epsilon
|
nonnegative float, the threshold at which to terminate the binary
search while searching for the minimal expected constraint violation
magnitude.
|
Returns |
The optimal distribution, as a numpy array of shape (n,).
|
Raises |
ValueError
|
If objective_vector and constraints_matrix have inconsistent
shapes, or if epsilon is negative.
|
ImportError
|
If we're unable to import scipy.optimize .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.constrained_optimization.find_best_candidate_distribution\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/constrained_optimization/python/candidates.py#L138-L221) |\n\nFinds a distribution minimizing an objective subject to constraints. \n\n tf.contrib.constrained_optimization.find_best_candidate_distribution(\n objective_vector, constraints_matrix, epsilon=0.0\n )\n\nThis function deals with the constrained problem:\n\u003e minimize f(w)\n\u003e s.t. g_i(w) \\\u003c= 0 for all i in {0,1,...,m-1}\n\nHere, f(w) is the \"objective function\", and g_i(w) is the ith (of m)\n\"constraint function\". Given a set of n \"candidate solutions\"\n{w_0,w*1,...,w*{n-1} }, this function finds a distribution over these n\ncandidates that, in expectation, minimizes the objective while violating\nthe constraints by the smallest possible amount (with the amount being found\nvia bisection search).\n\nThe `objective_vector` parameter should be a numpy array with shape (n,), for\nwhich objective_vector\\[i\\] = f(w_i). Likewise, `constraints_matrix` should be a\nnumpy array with shape (m,n), for which constraints_matrix\\[i,j\\] = g_i(w_j).\n\nThis function will return a distribution for which at most m+1 probabilities,\nand often fewer, are nonzero.\n\nFor more specifics, please refer to:\n\u003e Cotter, Jiang and Sridharan. \"Two-Player Games for Efficient Non-Convex\n\u003e Constrained Optimization\".\n\u003e \u003chttps://arxiv.org/abs/1804.06500\u003e\n\nThis function implements the approach described in Lemma 3.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `objective_vector` | numpy array of shape (n,), where n is the number of \"candidate solutions\". Contains the objective function values. |\n| `constraints_matrix` | numpy array of shape (m,n), where m is the number of constraints and n is the number of \"candidate solutions\". Contains the constraint violation magnitudes. |\n| `epsilon` | nonnegative float, the threshold at which to terminate the binary search while searching for the minimal expected constraint violation magnitude. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The optimal distribution, as a numpy array of shape (n,). ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|---------------|-------------------------------------------------------------------------------------------------------|\n| `ValueError` | If `objective_vector` and `constraints_matrix` have inconsistent shapes, or if `epsilon` is negative. |\n| `ImportError` | If we're unable to import `scipy.optimize`. |\n\n\u003cbr /\u003e"]]