Predictor

A module for making predictions on fabrication variations in photonic devices using machine learning models deployed in the cloud.


predict

predict(device, model_name, model_tags, binarize=False)

Generates a prediction for a photonic device using a specified cloud-based ML model.

The function sends an image of the device to a cloud function, which uses the specified machine learning model to generate a prediction.

Parameters

  • Name
    device
    Type
    np.ndarray
    Description

    A binary numpy matrix representing the shape of a device.

  • Name
    model_name
    Type
    str
    Description

    The name of the ML model to use for the prediction. Consult the module's documentation for available models.

  • Name
    model_tags
    Type
    Union[str, List[str]]
    Description

    The tags of the ML model. Consult the module's documentation for available tags.

  • Name
    binarize
    Type
    bool, optional
    Description

    If set to True, the prediction will be binarized (default is False).

Returns

  • Name
    prediction
    Type
    np.ndarray
    Description

    A numpy matrix representing the predicted shape of the device. Pixel values closer to 1 indicate a higher likelihood of core material, while pixel values closer to 0 suggest a higher likelihood of cladding material. Pixel values in between represent prediction uncertainty.


correct

correct(device, model_name, model_tags, binarize=False, multi_correct: bool=False)

Generates a correction for a photonic device using a specified cloud-based ML model.

The function sends an image of the device to a cloud function, which uses the specified machine learning model to generate a correction.

Parameters

  • Name
    device
    Type
    np.ndarray
    Description

    A binary numpy matrix representing the shape of a device.

  • Name
    model_name
    Type
    str
    Description

    The name of the ML model to use for the correction. Consult the module's documentation for available models.

  • Name
    model_tags
    Type
    Union[str, List[str]]
    Description

    The tags of the ML model. Consult the module's documentation for available tags.

  • Name
    binarize
    Type
    bool, optional
    Description

    If set to True, the correction will be binarized (default is False).

  • Name
    multi_correct
    Type
    bool, optional
    Description

    If set to True, the correction will be generated using a iterative approach (default is False).

Returns

  • Name
    correction
    Type
    np.ndarray
    Description

    A numpy matrix representing the corrected shape of the device. Pixel values closer to 1 indicate a higher likelihood of core material, while pixel values closer to 0 suggest a higher likelihood of cladding material. Pixel values in between represent correction uncertainty.