snapchat.research.gbml.training_samples_schema_pb2#

@generated by mypy-protobuf. Do not edit manually! isort:skip_file

Attributes#

Classes#

Label

Abstract base class for protocol messages.

NodeAnchorBasedLinkPredictionSample

Abstract base class for protocol messages.

RootedNodeNeighborhood

Store each node and related neighborhood subgraph

SupervisedLinkBasedTaskSample

The SupervisedLinkBasedTaskSample can be used for both

SupervisedNodeClassificationSample

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

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
LABEL_FIELD_NUMBER: int[source]#
LABEL_TYPE_FIELD_NUMBER: int[source]#
label: int[source]#
label_type: str[source]#
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:
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.

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
HARD_NEG_EDGES_FIELD_NUMBER: int[source]#
NEG_EDGES_FIELD_NUMBER: int[source]#
NEIGHBORHOOD_FIELD_NUMBER: int[source]#
POS_EDGES_FIELD_NUMBER: int[source]#
ROOT_NODE_FIELD_NUMBER: int[source]#
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:

snapchat.research.gbml.graph_schema_pb2.Graph

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:

snapchat.research.gbml.graph_schema_pb2.Node

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:
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.

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
NEIGHBORHOOD_FIELD_NUMBER: int[source]#
ROOT_NODE_FIELD_NUMBER: int[source]#
property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#

k-hop neighborhood of the root_node

Return type:

snapchat.research.gbml.graph_schema_pb2.Graph

property root_node: snapchat.research.gbml.graph_schema_pb2.Node[source]#

The main node for the sample

Return type:

snapchat.research.gbml.graph_schema_pb2.Node

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:
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.

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
NEIGHBORHOOD_FIELD_NUMBER: int[source]#
ROOT_EDGE_FIELD_NUMBER: int[source]#
ROOT_EDGE_LABELS_FIELD_NUMBER: int[source]#
property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#

Contains the k hop neighborhood for both nodes composing the root_edge

Return type:

snapchat.research.gbml.graph_schema_pb2.Graph

property root_edge: snapchat.research.gbml.graph_schema_pb2.Edge[source]#

The main edge for the sample

Return type:

snapchat.research.gbml.graph_schema_pb2.Edge

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:
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.

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
NEIGHBORHOOD_FIELD_NUMBER: int[source]#
ROOT_NODE_FIELD_NUMBER: int[source]#
ROOT_NODE_LABELS_FIELD_NUMBER: int[source]#
property neighborhood: snapchat.research.gbml.graph_schema_pb2.Graph[source]#

k-hop neighborhood of the root_node

Return type:

snapchat.research.gbml.graph_schema_pb2.Graph

property root_node: snapchat.research.gbml.graph_schema_pb2.Node[source]#

The main node for the sample

Return type:

snapchat.research.gbml.graph_schema_pb2.Node

property root_node_labels: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label][source]#
Return type:

google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label]

snapchat.research.gbml.training_samples_schema_pb2.DESCRIPTOR: google.protobuf.descriptor.FileDescriptor[source]#
snapchat.research.gbml.training_samples_schema_pb2.global___Label[source]#
snapchat.research.gbml.training_samples_schema_pb2.global___NodeAnchorBasedLinkPredictionSample[source]#
snapchat.research.gbml.training_samples_schema_pb2.global___RootedNodeNeighborhood[source]#
snapchat.research.gbml.training_samples_schema_pb2.global___SupervisedLinkBasedTaskSample[source]#
snapchat.research.gbml.training_samples_schema_pb2.global___SupervisedNodeClassificationSample[source]#