Skip to content

[RFC]: add Type hints across examples/ directory. (tracking issue) #124

@Neerajpathak07

Description

@Neerajpathak07

In the current code convention across examples/ directory multiple files define functions as:-

def logistic_loss(params, feature_matrix, labels):

Upon adding the respective Type hints this function would now be modified to:-

def logistic_loss(
    params: Mapping[str, Any],
    feature_matrix: Any,  # PyTree of arrays
    labels: jax.Array,
) -> jax.Array:

Why this variant is helpful as Type hints prevent pytype errors and JAX tracing ambiguity. Making the example rudimentary to opt with JAX core library components.

  • dp_logistic_regression.py
  • jax_api_example
  • keras_api_example.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions