hoops_ai.ml.EXPERIMENTAL.flexible_flow_model
Classes
|
Child class with default 'dummy' implementations of the abstract methods. |
- class hoops_ai.ml.EXPERIMENTAL.flexible_flow_model.CustomFlowModel(encode_cad_data_fn=None, encode_label_data_fn=None, convert_encoded_data_to_graph_fn=None, load_model_input_from_files_fn=None, collate_function_fn=None, retrieve_model_fn=None, model_name_fn=None, get_citation_info_fn=None, predict_and_postprocess_fn=None, metrics_fn=None)
Bases:
FlowModelChild class with default ‘dummy’ implementations of the abstract methods. Users can pass in custom callables (strategies) to override each method’s behavior.
- Parameters:
encode_cad_data_fn (Callable[[str, CADLoader, DataStorage], Tuple[int, int]] | None)
encode_label_data_fn (Callable[[LabelStorage, DataStorage], Tuple[str, int]] | None)
convert_encoded_data_to_graph_fn (Callable[[DataStorage, MLStorage, str], Dict[str, Any]] | None)
load_model_input_from_files_fn (Callable[[str, int, str | None], Any] | None)
retrieve_model_fn (Callable[[str | None], pytorch_lightning.LightningModule] | None)
metrics_fn (Callable[[], MetricStorage] | None)
- 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:
storage (DataStorage)
graph (MLStorage)
filename (str)
- Return type:
- 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:
cad_file (str)
cad_access (CADLoader)
storage (DataStorage)
- Return type:
- 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:
label_storage (LabelStorage)
storage (DataStorage)
- Return type:
- get_citation_info()
Provides citation details for the model, including author, paper, publication year, and open-source references.
- 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
- metrics()
Publish/push the ml metrics after traiing the model
- Return type:
- predict_and_postprocess(batch)
Post-processes and formats the raw model output into a structured prediction.
- Return type: