Tensorflow batching Kotlin - tensorflow

So I have a list of images, and I want to load them as batches, is there anyone who could help me write a function that gets me from a list of images to an inputBuffer ?
Thank you

Related

Can anyone please help me with generating new images using GAN?

I've been trying to generate (255x255) images using GAN, although I am able to train and generate 28x28 MNIST images, but I'm not able to generate custom images. I tried changing a lot of parameters in generator and discriminator networks, but I'm not able to generate even a single image. All I can see is a blank or dark image. Please help me with a proper solution as I'm approaching my semester deadline.
the output which im getting
output which im expecting

Is it possible to add custom entity labels to Spacy 3.0 config file?

I'm working on a custom NER model with spacy-transformers and roBERTa. I'm really only using the CLI for this and am trying to alter my Spacy config.cfg file to account for custom entity labels in the pipeline.
I'm new to Spacy, but I've gathered that people usually use ner.add_label to accomplish this. I wonder if I might be able to change something in [initialize.components.ner.labels] of the config, but haven't come across a good way to do that.
I can't seem to find any options to alter the config file in a similar fashion - does anyone know if this is possible, or what might be the most succinct way to achieve those custom labels?
Edited for clarity: My issue could be different than my config theory. Right now I am getting an output, but instead of text labels they are numeric labels, such as:
('Oct',383) ('2019',383) ('February',383)
Thank you in advance for your help!
If you are working with the config-based training, generally you should not have to specify the labels anywhere - spaCy will look at the training data and get the list of labels from there.
There are a few cases where this won't work.
You have labels that aren't in your training data. These can't be learned so I would just consider this an error, but sometimes you have to work with the data you've been given.
You training data is very large. In this case reading over all the training data to get a complete list of labels can be an issue. You can use the init labels command to generate data so that the input data doesn't have to be scanned every time you start training.

Audio_generator keras

I am trying to classify wav files into different classes. However the number of sound files is far more than what I can load on my RAM (>10000 files). So the only optimum way I can input these files is in batches, by using a DataGenerator function (like the ImageGenerator Function & flow_from_directory). Can someone please help me with it? I have a custom spectrogram function that i would like to apply on each wav file as it is being processed.

How to traverse examples in tf.data.Dataset backward?

Usually when using tensorflow dataset api, assuming there is not shuffling, tensorflow will retrieve the first serialized example of the tfrecords, and then proceeds sequentially to retrieve the remaining examples. Therefore, is there a way to start from the last example, and then proceed backwards?
Any help is much appreciated!!

tensorflow: how to get image or sample id?

I have encountered a problem for mnist dataset on tensorflow. As you probably know, using batches it does not preserve order on datasets but I need to know exactly which image of the samples I am working on. Does TF have any kind of indicator such as ID or some information that tells you which images it has extracted? For instance in one batch we may get images 20,1,4,6 and in another we get 3,7,88 etc from mnist. I want to have access to these IDs, is this possible?
You can always add your own indication; when you enqueue the features and labels you can enqueue the indicator as well.