Selecting from a minibatch iterator

5 views
Skip to first unread message

Burak Acar

unread,
Dec 28, 2019, 2:51:30 AM12/28/19
to knet-users
Hi,
Does anyone know how to select items from a minibatch iterator. Say, we have created a minibatch iterator with N tuples. How to get another minibatch iterator which is a subset of it? More generally, how to partition the minibatch iterator into 2 smaller minibatch iterators whose union make up the original one?

Burak

Deniz Yuret

unread,
Dec 29, 2019, 11:42:55 PM12/29/19
to Burak Acar, knet-users
The simple way would be to convert the iterator into a regular array (using `collect(iterator)`), then use array operations to do this.

The more complicated way would be to write a function that takes an iterator and produces another. However for small datasets this is unnecessary.

--
You received this message because you are subscribed to the Google Groups "knet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knet-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knet-users/b2d3136a-166e-4c5d-9d57-3af1dac6986d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages