snapchat.research.gbml.training_samples_schema_pb2#
@generated by mypy-protobuf. Do not edit manually! isort:skip_file
Attributes#
Classes#
Abstract base class for protocol messages. |
|
Abstract base class for protocol messages. |
|
Store each node and related neighborhood subgraph |
|
The SupervisedLinkBasedTaskSample can be used for both |
|
Abstract base class for protocol messages. |
Module Contents#
- class snapchat.research.gbml.training_samples_schema_pb2.Label(*, label_type=..., label=...)[source]#
Bases:
google.protobuf.message.Message
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- Parameters:
label_type (str)
label (int)
- ClearField(field_name)[source]#
Clears the contents of a given field.
Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group,
ValueError
is raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Raises:
ValueError – if the field_name is not a member of this message.
- Return type:
None
- class snapchat.research.gbml.training_samples_schema_pb2.NodeAnchorBasedLinkPredictionSample(*, root_node=..., hard_neg_edges=..., pos_edges=..., neg_edges=..., neighborhood=...)[source]#
Bases:
google.protobuf.message.Message
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- Parameters:
root_node (snapchat.research.gbml.graph_schema_pb2.Node | None)
hard_neg_edges (collections.abc.Iterable[snapchat.research.gbml.graph_schema_pb2.Edge] | None)
pos_edges (collections.abc.Iterable[snapchat.research.gbml.graph_schema_pb2.Edge] | None)
neg_edges (collections.abc.Iterable[snapchat.research.gbml.graph_schema_pb2.Edge] | None)
neighborhood (snapchat.research.gbml.graph_schema_pb2.Graph | None)
- ClearField(field_name)[source]#
Clears the contents of a given field.
Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group,
ValueError
is raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Raises:
ValueError – if the field_name is not a member of this message.
- Return type:
None
- HasField(field_name)[source]#
Checks if a certain field is set for the message.
For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor,
ValueError
will be raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Returns:
Whether a value has been set for the named field.
- Return type:
bool
- Raises:
ValueError – if the field_name is not a member of this message.
- property hard_neg_edges: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge][source]#
destination node is a negative example to the root_node Can be “fake” edges i.e. destination is a non neighbor of the root_node or user-defined
- Type:
Hard negative edges
- Return type:
google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge]
- property neg_edges: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge][source]#
(DEPRECATED) Random negatives edges, now provided by batch-shared random negatives in RootedNodeNeighborhood and in-batch negatives
- Return type:
google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge]
- property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#
The khop neighborhoods of root/pos/neg nodes are merged in proto definition, therefore in training additional fast tree search needs to be done to retrieve the relevant k hop neighborhoods for each node
- Return type:
- property pos_edges: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge][source]#
destination node is a positive example to the root_node Can be “real” edges i.e. destination is a neighbor of the root_node or user-defined
- Type:
Positive edges
- Return type:
google.protobuf.internal.containers.RepeatedCompositeFieldContainer[snapchat.research.gbml.graph_schema_pb2.Edge]
- property root_node: snapchat.research.gbml.graph_schema_pb2.Node[source]#
The main node for the sample
- Return type:
- class snapchat.research.gbml.training_samples_schema_pb2.RootedNodeNeighborhood(*, root_node=..., neighborhood=...)[source]#
Bases:
google.protobuf.message.Message
Store each node and related neighborhood subgraph can be used for storing random negative samples
- Parameters:
root_node (snapchat.research.gbml.graph_schema_pb2.Node | None)
neighborhood (snapchat.research.gbml.graph_schema_pb2.Graph | None)
- ClearField(field_name)[source]#
Clears the contents of a given field.
Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group,
ValueError
is raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Raises:
ValueError – if the field_name is not a member of this message.
- Return type:
None
- HasField(field_name)[source]#
Checks if a certain field is set for the message.
For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor,
ValueError
will be raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Returns:
Whether a value has been set for the named field.
- Return type:
bool
- Raises:
ValueError – if the field_name is not a member of this message.
- property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#
k-hop neighborhood of the root_node
- Return type:
- property root_node: snapchat.research.gbml.graph_schema_pb2.Node[source]#
The main node for the sample
- Return type:
- class snapchat.research.gbml.training_samples_schema_pb2.SupervisedLinkBasedTaskSample(*, root_edge=..., neighborhood=..., root_edge_labels=...)[source]#
Bases:
google.protobuf.message.Message
The SupervisedLinkBasedTaskSample can be used for both Link-classification-based link prediction tasks & Edge level prediction tasks
- Parameters:
root_edge (snapchat.research.gbml.graph_schema_pb2.Edge | None)
neighborhood (snapchat.research.gbml.graph_schema_pb2.Graph | None)
root_edge_labels (collections.abc.Iterable[global___Label] | None)
- ClearField(field_name)[source]#
Clears the contents of a given field.
Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group,
ValueError
is raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Raises:
ValueError – if the field_name is not a member of this message.
- Return type:
None
- HasField(field_name)[source]#
Checks if a certain field is set for the message.
For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor,
ValueError
will be raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Returns:
Whether a value has been set for the named field.
- Return type:
bool
- Raises:
ValueError – if the field_name is not a member of this message.
- property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#
Contains the k hop neighborhood for both nodes composing the root_edge
- Return type:
- property root_edge: snapchat.research.gbml.graph_schema_pb2.Edge[source]#
The main edge for the sample
- Return type:
- property root_edge_labels: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label][source]#
Allow multiple edge labels with different type ex. Snap view as target label, and Story view as target label
- Return type:
google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label]
- class snapchat.research.gbml.training_samples_schema_pb2.SupervisedNodeClassificationSample(*, root_node=..., neighborhood=..., root_node_labels=...)[source]#
Bases:
google.protobuf.message.Message
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- Parameters:
root_node (snapchat.research.gbml.graph_schema_pb2.Node | None)
neighborhood (snapchat.research.gbml.graph_schema_pb2.Graph | None)
root_node_labels (collections.abc.Iterable[global___Label] | None)
- ClearField(field_name)[source]#
Clears the contents of a given field.
Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group,
ValueError
is raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Raises:
ValueError – if the field_name is not a member of this message.
- Return type:
None
- HasField(field_name)[source]#
Checks if a certain field is set for the message.
For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor,
ValueError
will be raised.- Parameters:
field_name (str) – The name of the field to check for presence.
- Returns:
Whether a value has been set for the named field.
- Return type:
bool
- Raises:
ValueError – if the field_name is not a member of this message.
- property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#
k-hop neighborhood of the root_node
- Return type:
- property root_node: snapchat.research.gbml.graph_schema_pb2.Node[source]#
The main node for the sample
- Return type:
- snapchat.research.gbml.training_samples_schema_pb2.DESCRIPTOR: google.protobuf.descriptor.FileDescriptor[source]#