Houdini 20.5 Nodes Geometry nodes

ML Example geometry node

Create examples from input components and an optional target components

On this page

Overview

ML Example allows you to combine an input geometry with a desired output called a target which results in a labeled example. A data set for ML training can be formed by combining multiple labeled examples. See Machine Learning documentation for more general information.

Regression is a type of supervised machine learning where a continuous function is learned from a set of labeled examples. Each labeled example consists of two components: an input component and a target component. The ML Example node creates a labeled example from these two components. Given a labeled example, the input component and the target component can be retrieved using ML Example Decompose. ML Example Decompose can be seen as the reverse operation of ML Example.

For each given input, a corresponding target may be generated by applying a procedural network. This way, a synthetic data set consisting of labeled examples can be formed which can be used for ML training.

In addition to labeled examples, ML Example can also create unlabeled examples. This is done by leaving the optional Target Component input unconnected.

Keeping inputs and targets tied together as labeled examples has advantages when preprocessing a data set. If outliers need to be rejected, a labeled example can be discarded without having to deal with indexing mismatches between inputs and targets. Having each input and target component bundled together also facilitates preprocessing steps where the transformation of either the input or the target depends on both the input and the target.

Because each labeled example is stored as a packed primitive, a single geometry may store multiple labeled examples. Sets of labeled examples may be merged together by merging the geometries that contain them in SOPs. A geometry containing labeled examples can be written as a data set for training using ML Example Output.

Instead of creating a single example at a time, you can use ML Example to create a set of examples at once. If you have a number of packed input components and the same number of packed target components, ML Example will zip together the inputs and targets to create an example for each corresponding input-target pair. To do this, turn on both Use Packed Input Component and Use Packed Target Component. However, if either Use Packed Input Component and Use Packed Target Component is disabled, ML Example treats both inputs as a single component and creates only a single example.

The options for using packed components can also be useful when all the input and target contributions (e.g., point attributes and volumes) from which you want to construct an example belong to a single geometry. In that case, that single geometry should be packed using Pack SOP and then connected to both inputs of ML Example. This prevents the single geometry from being duplicated while all downstream ML nodes can work the usual way.

Sometimes, you may want to discard examples that are outliers (e.g., the results of failed simulations). For this purpose, the input component and the target component that go into an ML Example can be marked as invalid using detail attributes that can be specified by Input Validity Attribute and Target Validity Attribute. For the input comonent, this works only if Use Packed Input Component is disabled. The same principle applies for the target component.

Representation

Example sets are represented as geometry, which may be manipulated in a Geometry network. The example-based ML nodes expect and maintain specific rules for representing examples this way. Each example is represented by a packed primitive. A geometry that represents a set of examples must consist only of packed primitives.

The representation of unlabeled and labeled examples is different. An unlabeled example is a packed primitive, whose embedded geometry is the contents of the example (the input component). This allows you to use any set of packed primitives as unlabeled examples with the example-based ML nodeset.

A labeled example is a packed primitive that contains two packed primitives: the input component and target component. This allows unlabeled examples to be labeled without copying their embedded geometries. Labeled examples must be part of a primitive group called labeledexamples. Unlabeled examples either don’t have the group labeledexamples or are not a member of it.

To summarize:

  • Any geometry representing a set of examples should consist entirely of packed primitives.

  • If the geometry doesn’t have the labeledexamples primitive group, each of the packed primitives is treated as an unlabeled example by the ML nodes.

  • If the geometry has the labeledexamples primitive group, members of this group are treated as labeled examples and the remaining primitives are treated as unlabeled examples.

When you use the example-based ML nodes, the above representation rules are being applied for you and should not concern you too much.

Parameters

Use Packed Input Component

Use the packed input component to construct the example. This can avoid copying the embedded geometry of the packed input component.

Use Packed Target Component

Use the packed target component to construct the example. This can avoid copying the embedded geometry of the packed target component.

Input Validity Attribute

The name of an attribute that indicates whether the first input (Input) is valid. This is a primitive attribute if the input is packed and a detail attribute if the input is unpacked. If this attribute exists and has value 0, then the result is an empty geometry, representating an invalid labeled example. This option is a convenient way for discarding invalid labeled examples when building a set.

Target Validity Attribute

The name of an attribute that indicates whether the second input target (Target) is valid. This is a primitive attribute if the input is packed and a detail attribute if the input is unpacked. If this attribute exists and has value 0, then the result is an empty geometry, representating an invalid labeled example.

Inputs

Input Component

An input component of each example.

Target Component

A target component of each example.

Outputs

Example

The packed-primitive representation of each example.

Geometry nodes