how to train GANs properly - python

I started experimenting with gans and on the internet, there are a lot of options the thing I worry about now is which one should I use Keras fit or Keras train_on_batchs which one is the proper way to train the model thanks

According to tensorflow's documentation, the combination of tf.data & model.train_on_batch() is the fastest way to train a model.
You can check more about tf.data in the link below:
https://www.tensorflow.org/guide/data
I have already implemented GANs with keras. My implementations might help you get an idea how to train those models:
https://github.com/kochlisGit/Keras-GAN

Related

RayTune for Hyperparameters optimization of an LSTM model in PyTorch

I am trying to implement RayTune hyperparameter optimization for an LSTM model in Pytorch, but i really struggle to get in touch with it. I googled my question but I didn't find any usefull articles. The LSTM I am trying to use is for timeseries forecasting, and all that I could found on the internet was for the image classification, as in their example on Pytorch.
Any usefull resources that might help me will be much apreciatted. Thanks!

pytorch: implementing a custom optimizer

I'm trying to implement a slightly different version of SGD with pytorch and test it on some datasets. I need to write a custom optimizer on which to train my model, however I cannot find any guide which explains how to do so. Is anyone able to tell me how I can proceed or suggest me any useful reference?
Thanks in advance.

Using tensorflow classification for feature extraction

I am currently working on a system that extracts certain features out of 3D-objects (Voxelgrids to be precise), and i would like to compare those features to automatically made features when it comes to performance (classification) in a tensorflow cNN with some other data, but that is not the point here, just for background.
My idea now was, to take a dataset (modelnet10), train a tensorflow cNN to classify them, and then use what it learned there on my dataset - not to classify, but to extract features.
So i want to throw away everything the cnn does,except for what it takes from the objects.
Is there anyway to get these features? and how do i do that? i certainly have no idea.
Yes, it is possible to train models exclusively for feature extraction. This is called transfer learning where you can either train your own model and then extract the features or you can extract features from pre-trained models and then use it in your task if your task is similar in nature to that of what the pre-trained model was trained for. You can of course find a lot of material online for these topics. However, I am providing some links below which give details on how you can go about it:
https://keras.io/api/applications/
https://keras.io/guides/transfer_learning/
https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/
https://www.pyimagesearch.com/2019/05/27/keras-feature-extraction-on-large-datasets-with-deep-learning/
https://www.kaggle.com/angqx95/feature-extractor-fine-tuning-with-keras

How to apply TensorFlow Text Classification on new dataset?

I am following this tutorial:
https://www.tensorflow.org/tutorials/keras/text_classification_with_hub
It only goes up to fitting the model but I couldn't find how to use the model on a new dataset to classify unlabeled data. I tried following other tutorials but I couldn't get them to work since they might not be text based.
model.add(tf.keras.layers.Dense(1))
I run into an issue where I try to set the layer to 2 for positive, negative but that doesn't work either.
I think you misunderstood the purpose of that tutorial. That tutorial is applying the use of what is known as "transfer learning". Transfer Learning is when you take an already trained model, and train it with other data. What you are doing is creating an entirely new model, which is not the purpose of that specific tutorial. Furthermore, for that model you need a labeled dataset, which is provided in the tutorial using the Tensorflow Datasets library. To accomplish what you are trying to do, you must look at a different tutorial explaining how to train an LSTM model for text classification from scratch.

Faster RCNN transfer learning Keras

I have implemented with my own custom dataset a faster RCNN in Keras following this very useful guide:
https://medium.com/analytics-vidhya/a-practical-implementation-of-the-faster-r-cnn-algorithm-for-object-detection-part-2-with-cac45dada619
I would like to ask you some details in that implementation for those of you that already had a similar experience on that:
Once I the code is running the compiler returns: "Could not load pretrained model weights. Weights can be found in the keras application folder \https://github.com/fchollet/keras/tree/master/keras/applications", Does it mean that I not exploiting transfer learning?
Do you know something on that?
Thanks in advance

Categories