Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implements map_coordinates op in keras-core #784

Closed
wants to merge 5 commits into from

Conversation

mihirparadkar
Copy link
Contributor

@mihirparadkar mihirparadkar commented Aug 23, 2023

Adds the map_coordinates op as described in #477 .

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

if len(coordinates) != input_arr.ndim:
raise ValueError(
"coordinates must be a sequence of length input.ndim, but "
"{} != {}".format(len(coordinates), input_arr.ndim)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use f-strings rather than .format()


@keras_core_export("keras_core.ops.image.map_coordinates")
def map_coordinates(
input, coordinates, order, mode="constant", cval=0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument names should be consistent with the APIs we already have (like affine_transform), e.g. cval should be something like fill_value

):
"""Applies the image(s) onto a set of coordinates.

Args:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the docstring

(1, "reflect"),
]
)
def test_map_coordinates01(self, order, mode):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We likely need some more test coverage

@fchollet
Copy link
Member

Considering the PR is abandoned -- will set this as an "request for contributions" item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants