snapchat.research.gbml.subgraph_sampling_strategy_pb2#
@generated by mypy-protobuf. Do not edit manually! isort:skip_file
Attributes#
Sample incoming edges to the dst nodes (default) |
|
Sample outgoing edges from the src nodes |
|
Classes#
Abstract base class for protocol messages. |
|
Abstract base class for protocol messages. |
|
Abstract base class for protocol messages. |
|
Randomly sample nodes from the neighborhood without replacement. |
|
Sample based off some edge weight |
|
TODO: (svij) Define UserDefinedFilter interface |
|
Abstract base class for protocol messages. |
|
Order the edges based off of some edge feature and pick top K |
|
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.
- 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
- 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
- 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
- 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
- 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
- property edge_type: snapchat.research.gbml.graph_schema_pb2.EdgeType[source]#
- Return type:
- 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
- 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
- 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
- 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
- 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
- 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