tf.math.polyval
Stay organized with collections
Save and categorize content based on your preferences.
Computes the elementwise value of a polynomial.
tf.math.polyval(
coeffs, x, name=None
)
If x
is a tensor and coeffs
is a list n + 1 tensors, this function returns
the value of the n-th order polynomial
p(x) = coeffs[n-1] + coeffs[n-2] * x + ... + coeffs[0] * x**(n-1)
evaluated using Horner's method, i.e.
p(x) = coeffs[n-1] + x * (coeffs[n-2] + ... + x * (coeffs[1] +
x * coeffs[0]))
Args |
coeffs
|
A list of Tensor representing the coefficients of the polynomial.
|
x
|
A Tensor representing the variable of the polynomial.
|
name
|
A name for the operation (optional).
|
Returns |
A tensor of the shape as the expression p(x) with usual broadcasting rules
for element-wise addition and multiplication applied.
|
Numpy Compatibility
Equivalent to numpy.polyval.
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.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.math.polyval\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/math/polyval) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/ops/math_ops.py#L4119-L4158) |\n\nComputes the elementwise value of a polynomial.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.math.polyval`](/api_docs/python/tf/math/polyval)\n\n\u003cbr /\u003e\n\n tf.math.polyval(\n coeffs, x, name=None\n )\n\nIf `x` is a tensor and `coeffs` is a list n + 1 tensors, this function returns\nthe value of the n-th order polynomial\n\np(x) = coeffs\\[n-1\\] + coeffs\\[n-2\\] \\* x + ... + coeffs\\[0\\] \\* x\\*\\*(n-1)\n\nevaluated using Horner's method, i.e.\n\np(x) = coeffs\\[n-1\\] + x \\* (coeffs\\[n-2\\] + ... + x \\* (coeffs\\[1\\] +\nx \\* coeffs\\[0\\]))\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|---------------------------------------------------------------------|\n| `coeffs` | A list of `Tensor` representing the coefficients of the polynomial. |\n| `x` | A `Tensor` representing the variable of the polynomial. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `tensor` of the shape as the expression p(x) with usual broadcasting rules for element-wise addition and multiplication applied. ||\n\n\u003cbr /\u003e\n\n#### Numpy Compatibility\n\nEquivalent to numpy.polyval."]]