multik icon indicating copy to clipboard operation
multik copied to clipboard

Add Tile function

Open zaleslaw opened this issue 2 years ago • 2 comments

Hi, I'm going to implement the postprocessing for the YOLOv4 model in the KotlinDL library, but it requires many different analogs of the NumPy functions.

Could you please add the analogue of the np.tile function?

zaleslaw avatar Aug 18 '21 15:08 zaleslaw

This function is quite extensive. In essence, this is broadcasting with the creation of an array. The difficulty is adding such a function to the api, can you give specific cases of using this function in the yolo model?

devcrocod avatar Oct 01 '21 10:10 devcrocod

This is a script which should be ported, looks like it involves broadcasting, due to expand_dims usage

        xy_grid = np.meshgrid(np.arange(output_size), np.arange(output_size))
        xy_grid = np.expand_dims(np.stack(xy_grid, axis=-1), axis=2)

        xy_grid = np.tile(np.expand_dims(xy_grid, axis=0), [1, 1, 1, 3, 1])
        xy_grid = xy_grid.astype(np.float)

zaleslaw avatar Oct 01 '21 11:10 zaleslaw