hoops_ai.ml.EXPERIMENTAL.flow_model

Classes

FlowModel()

Interface for Flow models defining ML architectures.

class hoops_ai.ml.EXPERIMENTAL.flow_model.FlowModel

Bases: ABC

Interface for Flow models defining ML architectures.

collate_function(batch)

Return a collated batch for this model.

Return type:

Any

convert_encoded_data_to_graph(storage, graph, filename)

Converts encoded data from storage into a graph representation, which serves as input for the ML model. use graph.save_graph(filename) to save the graph in a file

Parameters:
Return type:

Dict[str, Any]

abstract encode_cad_data(cad_file, cad_access, storage)

Opens the CAD file and encodes its data into a format suitable for machine learning. Stores the encoded data using the provided storage handler. return the tuple [face_count, edge_count]

Parameters:
Return type:

Tuple[int, int]

encode_label_data(label_storage, storage)

Uses the LabelStorage object to retrieve the labeling information for a given input Stores the label data for the specific machine learning Task

return the str key when the label data is found in the storage object and the size of the label data

Parameters:
Return type:

Tuple[str, int]

get_citation_info()

Provides citation details for the model, including author, paper, publication year, and open-source references.

Return type:

Dict[str, Any]

load_model_input_from_files(graph_file, data_id, label_file=None)

Loads the graph created in method convert_encoded_data_to_graph from a file. the return of this method is exactly the input as expected by the machine learning model the label_file is optional. If not given, the method should return a valid object.

This method will be called multiple times by the DatasetLoader. This method will be called with label_file == None for doing inference

Parameters:
  • graph_file (str)

  • data_id (int)

  • label_file (str)

Return type:

Any

metrics()

Publish/push the ml metrics after traiing the model

Return type:

MetricStorage

model_name()

Provides the name of the model.

Return type:

str

predict_and_postprocess(batch)

Post-processes and formats the raw model output into a structured prediction.

Return type:

Any

retrieve_model(check_point=None)

Retrieves the PyTorch Lightning model used in this flow.

Parameters:

check_point (str)

Return type:

pytorch_lightning.LightningModule