-
Notifications
You must be signed in to change notification settings - Fork 0
If Operation
Elementwise selecting of one of two inputs given a condition.
BS.Boolean.If (condition, thenValue, elseValue)
-
condition: condition according to which element values are selected -
thenValue: element value selected ifconditionelement is not 0 -
elseValue: element value selected ifconditionelement is 0
Sparse values are currently not supported.
A tensor of the dimension of the inputs. If any of the inputs have dimensions of 1, broadcasting is applied; in that case, the output dimension becomes the maximum over the corresponding three arguments' dimensions.
If() selects elements from two inputs based on a condition, in an elementwise fashion.
For every input element where condition is non-0, the corresponding element from thenValue
is chosen; and where condition is 0, the corresponding elseValue element is chosen.
This function supports broadcasting. For example, it is possible that the condition is a scalar, or one of the inputs is a constant tensor without time dimension.
The elementwise maximum of two inputs can be computed as a combination of Greater() and If():
MyElementwiseMax (a, b) = BS.Boolean.If (Greater (a, b), a, b)
This also works with broadcasting. For example, the linear rectifier can be written with this using a scalar constant as the second input:
MyReLU (x) = MyElementwiseMax (x, Constant(0))
- Home
- What's new
- Breaking changes
- CNTK installation
- Python API / Docs
- FAQ
- How do I...
- Troubleshoot CNTK
Getting Started
Additional Documentation
How to use CNTK
Using CNTK Models in Your Code
Advanced topics
- BrainScript via command line
- Top-level commands
- Working with sequences
- Plot Command
- ConvertDBN Command
- Baseline Metrics
Licenses
Source Code & Development