deepmd.tf.utils.graph
Module Contents
Functions
| Load graph as well as the graph_def from the frozen model(model_file). |
| Load tensor value from the given tf.Graph object. |
| Load tensor value from the frozen model(model_file). |
| Get the pattern nodes with the given tf.GraphDef object. |
Get the embedding net nodes with the given tf.GraphDef object. | |
| Get the embedding net nodes with the given frozen model(model_file). |
Get the embedding net variables with the given tf.GraphDef object. | |
| Get the extra embedding net suffix according to the value of type_one_side. |
| Get variables from the given tf.GraphDef object, with numpy array returns. |
Get extra embedding net variables from the given tf.GraphDef object. | |
| Get the embedding net variables with the given frozen model(model_file). |
Get the fitting net nodes with the given tf.GraphDef object. | |
| Get the fitting net nodes with the given frozen model(model_file). |
Get the fitting net variables with the given tf.GraphDef object. | |
| Get the fitting net variables with the given frozen model(model_file). |
Get the type embedding net nodes with the given tf.GraphDef object. | |
Get the type embedding net variables with the given tf.GraphDef object. | |
Get the attention layer nodes with the given tf.GraphDef object. | |
Get the attention layer variables with the given tf.GraphDef object. | |
| Convert tensor to ndarray in dict. |
- deepmd.tf.utils.graph.load_graph_def(model_file: str) Tuple[deepmd.tf.env.tf.Graph, deepmd.tf.env.tf.GraphDef] [source]
Load graph as well as the graph_def from the frozen model(model_file).
- deepmd.tf.utils.graph.get_tensor_by_name_from_graph(graph: deepmd.tf.env.tf.Graph, tensor_name: str) deepmd.tf.env.tf.Tensor [source]
Load tensor value from the given tf.Graph object.
- deepmd.tf.utils.graph.get_tensor_by_name(model_file: str, tensor_name: str) deepmd.tf.env.tf.Tensor [source]
Load tensor value from the frozen model(model_file).
- deepmd.tf.utils.graph.get_pattern_nodes_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, pattern: str) Dict [source]
Get the pattern nodes with the given tf.GraphDef object.
- Parameters:
- graph_def
The input tf.GraphDef object
- pattern
The node pattern within the graph_def
- Returns:
Dict
The fitting net nodes within the given tf.GraphDef object
- deepmd.tf.utils.graph.get_embedding_net_nodes_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the embedding net nodes with the given tf.GraphDef object.
- deepmd.tf.utils.graph.get_embedding_net_nodes(model_file: str, suffix: str = '') Dict [source]
Get the embedding net nodes with the given frozen model(model_file).
- deepmd.tf.utils.graph.get_embedding_net_variables_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the embedding net variables with the given tf.GraphDef object.
- deepmd.tf.utils.graph.get_extra_embedding_net_suffix(type_one_side: bool)[source]
Get the extra embedding net suffix according to the value of type_one_side.
- Parameters:
- type_one_side
The value of type_one_side
- Returns:
str
The extra embedding net suffix
- deepmd.tf.utils.graph.get_variables_from_graph_def_as_numpy_array(graph_def: deepmd.tf.env.tf.GraphDef, pattern: str)[source]
Get variables from the given tf.GraphDef object, with numpy array returns.
- Parameters:
- graph_def
The input tf.GraphDef object
- pattern
str
The name of variable
- Returns:
np.ndarray
The numpy array of the variable
- deepmd.tf.utils.graph.get_extra_embedding_net_variables_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str, extra_suffix: str, layer_size: int)[source]
Get extra embedding net variables from the given tf.GraphDef object. The “extra embedding net” means the embedding net with only type embeddings input, which occurs in “se_atten_v2” and “se_a_ebd_v2” descriptor.
- Parameters:
- Returns:
Dict
The extra embedding net variables within the given tf.GraphDef object
- deepmd.tf.utils.graph.get_embedding_net_variables(model_file: str, suffix: str = '') Dict [source]
Get the embedding net variables with the given frozen model(model_file).
- deepmd.tf.utils.graph.get_fitting_net_nodes_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the fitting net nodes with the given tf.GraphDef object.
- Parameters:
- graph_def
The input tf.GraphDef object
- suffix
suffix of the scope
- Returns:
Dict
The fitting net nodes within the given tf.GraphDef object
- deepmd.tf.utils.graph.get_fitting_net_nodes(model_file: str) Dict [source]
Get the fitting net nodes with the given frozen model(model_file).
- Parameters:
- model_file
The input frozen model path
- Returns:
Dict
The fitting net nodes with the given frozen model
- deepmd.tf.utils.graph.get_fitting_net_variables_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the fitting net variables with the given tf.GraphDef object.
- Parameters:
- graph_def
The input tf.GraphDef object
- suffix
suffix of the scope
- Returns:
Dict
The fitting net variables within the given tf.GraphDef object
- deepmd.tf.utils.graph.get_fitting_net_variables(model_file: str, suffix: str = '') Dict [source]
Get the fitting net variables with the given frozen model(model_file).
- Parameters:
- model_file
The input frozen model path
- suffix
suffix of the scope
- Returns:
Dict
The fitting net variables within the given frozen model
- deepmd.tf.utils.graph.get_type_embedding_net_nodes_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the type embedding net nodes with the given tf.GraphDef object.
- deepmd.tf.utils.graph.get_type_embedding_net_variables_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the type embedding net variables with the given tf.GraphDef object.
- deepmd.tf.utils.graph.get_attention_layer_nodes_from_graph_def(graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') Dict [source]
Get the attention layer nodes with the given tf.GraphDef object.