snapchat.research.gbml.subgraph_sampling_strategy_pb2#

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

Attributes#

Classes#

GlobalRandomUniformStrategy

Abstract base class for protocol messages.

MessagePassingPath

Abstract base class for protocol messages.

MessagePassingPathStrategy

Abstract base class for protocol messages.

RandomUniform

Randomly sample nodes from the neighborhood without replacement.

RandomWeighted

Sample based off some edge weight

SamplingDirection

SamplingOp

TODO: (svij) Define UserDefinedFilter interface

SubgraphSamplingStrategy

Abstract base class for protocol messages.

TopK

Order the edges based off of some edge feature and pick top K

UserDefined

Abstract base class for protocol messages.

Module Contents#

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.GlobalRandomUniformStrategy(*, num_hops=..., random_uniform_spec=...)[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:
  • num_hops (int)

  • random_uniform_spec (global___RandomUniform | 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.

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
NUM_HOPS_FIELD_NUMBER: int[source]#
RANDOM_UNIFORM_SPEC_FIELD_NUMBER: int[source]#
num_hops: int[source]#
property random_uniform_spec: global___RandomUniform[source]#
Return type:

global___RandomUniform

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.MessagePassingPath(*, root_node_type=..., sampling_ops=...)[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_type (str)

  • sampling_ops (collections.abc.Iterable[global___SamplingOp] | 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

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
ROOT_NODE_TYPE_FIELD_NUMBER: int[source]#
SAMPLING_OPS_FIELD_NUMBER: int[source]#
root_node_type: str[source]#
property sampling_ops: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SamplingOp][source]#
Return type:

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

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.MessagePassingPathStrategy(*, paths=...)[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:

paths (collections.abc.Iterable[global___MessagePassingPath] | 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

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
PATHS_FIELD_NUMBER: int[source]#
property paths: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MessagePassingPath][source]#

One message passing path needs to be specified per relevant node type i.e. for SupervisedNodeBasedTask, one message passing path per supervision node type for SupervisedLinkBasedTask, one message passing path per node type in the supervision edges We currently do not support multiple message passing paths for the same node type.

Type:

Note

Return type:

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

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.RandomUniform(*, num_nodes_to_sample=...)[source]#

Bases: google.protobuf.message.Message

Randomly sample nodes from the neighborhood without replacement.

Parameters:

num_nodes_to_sample (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]#
NUM_NODES_TO_SAMPLE_FIELD_NUMBER: int[source]#
num_nodes_to_sample: int[source]#
class snapchat.research.gbml.subgraph_sampling_strategy_pb2.RandomWeighted(*, num_nodes_to_sample=..., edge_feat_name=...)[source]#

Bases: google.protobuf.message.Message

Sample based off some edge weight

Parameters:
  • num_nodes_to_sample (int)

  • edge_feat_name (str)

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]#
EDGE_FEAT_NAME_FIELD_NUMBER: int[source]#
NUM_NODES_TO_SAMPLE_FIELD_NUMBER: int[source]#
edge_feat_name: str[source]#
num_nodes_to_sample: int[source]#
class snapchat.research.gbml.subgraph_sampling_strategy_pb2.SamplingDirection[source]#

Bases: _SamplingDirection

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.SamplingOp(*, op_name=..., edge_type=..., input_op_names=..., random_uniform=..., random_weighted=..., top_k=..., user_defined=..., sampling_direction=...)[source]#

Bases: google.protobuf.message.Message

TODO: (svij) Define UserDefinedFilter interface Rough idea of UserDefinedFilter interface class UserDefinedFilter:

def filter_next_hop_nodes_and_edges(

potential_next_hop: Tuple[Set(Edge), Set(Node)],

) -> Tuple[Set(Edge), Set(Node)] # Given a set of edges and nodes; the function filters the next hop nodes/edges

Parameters:
  • op_name (str)

  • edge_type (snapchat.research.gbml.graph_schema_pb2.EdgeType | None)

  • input_op_names (collections.abc.Iterable[str] | None)

  • random_uniform (global___RandomUniform | None)

  • random_weighted (global___RandomWeighted | None)

  • top_k (global___TopK | None)

  • user_defined (global___UserDefined | None)

  • sampling_direction (global___SamplingDirection)

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.

WhichOneof(oneof_group)[source]#

Returns the name of the field that is set inside a oneof group.

If no field is set, returns None.

Parameters:

oneof_group (str) – the name of the oneof group to check.

Returns:

The name of the group that is set, or None.

Return type:

str or None

Raises:

ValueError – no group with the given name exists

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
EDGE_TYPE_FIELD_NUMBER: int[source]#
INPUT_OP_NAMES_FIELD_NUMBER: int[source]#
OP_NAME_FIELD_NUMBER: int[source]#
RANDOM_UNIFORM_FIELD_NUMBER: int[source]#
RANDOM_WEIGHTED_FIELD_NUMBER: int[source]#
SAMPLING_DIRECTION_FIELD_NUMBER: int[source]#
TOP_K_FIELD_NUMBER: int[source]#
USER_DEFINED_FIELD_NUMBER: int[source]#
property edge_type: snapchat.research.gbml.graph_schema_pb2.EdgeType[source]#
Return type:

snapchat.research.gbml.graph_schema_pb2.EdgeType

property input_op_names: google.protobuf.internal.containers.RepeatedScalarFieldContainer[str][source]#

the list of upstream sampling operations in the DAG, empty if this is the root

Return type:

google.protobuf.internal.containers.RepeatedScalarFieldContainer[str]

op_name: str[source]#

1-100 field numbers reserved for expanding SamplingOp Can be used as a reference in other operations

property random_uniform: global___RandomUniform[source]#
Return type:

global___RandomUniform

property random_weighted: global___RandomWeighted[source]#
Return type:

global___RandomWeighted

sampling_direction: global___SamplingDirection[source]#

Sampling edge direction, INCOMING or OUTGOING. INCOMING is default since SamplingDirection enum defined INCOMING=0, OUTGOING=1 INCOMING - Sample incoming edges to the dst nodes (default) OUTGOING - Sample outgoing edges from the src nodes

property top_k: global___TopK[source]#
Return type:

global___TopK

property user_defined: global___UserDefined[source]#
Return type:

global___UserDefined

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.SubgraphSamplingStrategy(*, message_passing_paths=..., global_random_uniform=...)[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:
  • message_passing_paths (global___MessagePassingPathStrategy | None)

  • global_random_uniform (global___GlobalRandomUniformStrategy | 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.

WhichOneof(oneof_group)[source]#

Returns the name of the field that is set inside a oneof group.

If no field is set, returns None.

Parameters:

oneof_group (str) – the name of the oneof group to check.

Returns:

The name of the group that is set, or None.

Return type:

str or None

Raises:

ValueError – no group with the given name exists

DESCRIPTOR: google.protobuf.descriptor.Descriptor[source]#
GLOBAL_RANDOM_UNIFORM_FIELD_NUMBER: int[source]#
MESSAGE_PASSING_PATHS_FIELD_NUMBER: int[source]#
property global_random_uniform: global___GlobalRandomUniformStrategy[source]#

Randomly sample num nodes specified nodes of each node type without replacement

Return type:

global___GlobalRandomUniformStrategy

property message_passing_paths: global___MessagePassingPathStrategy[source]#
Return type:

global___MessagePassingPathStrategy

class snapchat.research.gbml.subgraph_sampling_strategy_pb2.TopK(*, num_nodes_to_sample=..., edge_feat_name=...)[source]#

Bases: google.protobuf.message.Message

Order the edges based off of some edge feature and pick top K

Parameters:
  • num_nodes_to_sample (int)

  • edge_feat_name (str)

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]#
EDGE_FEAT_NAME_FIELD_NUMBER: int[source]#
NUM_NODES_TO_SAMPLE_FIELD_NUMBER: int[source]#
edge_feat_name: str[source]#
num_nodes_to_sample: int[source]#
class snapchat.research.gbml.subgraph_sampling_strategy_pb2.UserDefined(*, path_to_udf=..., params=...)[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:
  • path_to_udf (str)

  • params (collections.abc.Mapping[str, str] | None)

class ParamsEntry(*, key=..., value=...)[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:
  • key (str)

  • value (str)

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]#
KEY_FIELD_NUMBER: int[source]#
VALUE_FIELD_NUMBER: int[source]#
key: str[source]#
value: str[source]#
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]#
PARAMS_FIELD_NUMBER: int[source]#
PATH_TO_UDF_FIELD_NUMBER: int[source]#
property params: google.protobuf.internal.containers.ScalarMap[str, str][source]#

Runtime params to pass into the class

Return type:

google.protobuf.internal.containers.ScalarMap[str, str]

path_to_udf: str[source]#

Define this interface)

Type:

Path to class that implements UserDefinedFilter interface (TODO

snapchat.research.gbml.subgraph_sampling_strategy_pb2.DESCRIPTOR: google.protobuf.descriptor.FileDescriptor[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.INCOMING: SamplingDirection[source]#

Sample incoming edges to the dst nodes (default)

snapchat.research.gbml.subgraph_sampling_strategy_pb2.OUTGOING: SamplingDirection[source]#

Sample outgoing edges from the src nodes

snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___GlobalRandomUniformStrategy[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___MessagePassingPath[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___MessagePassingPathStrategy[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___RandomUniform[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___RandomWeighted[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___SamplingDirection[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___SamplingOp[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___SubgraphSamplingStrategy[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___TopK[source]#
snapchat.research.gbml.subgraph_sampling_strategy_pb2.global___UserDefined[source]#