What is the better way to predict classes for the models developed using the functional API in Keras

We can predict the class for new data instances using the Sequential classification model in Keras using the predict_classes() function. What is the way to predict the class for models that developed using the functional API? For example, I have a model (functional API based) with sigmoid activation on the last layer to get probabilities in a multi-label classification. When I apply model.predict(), I got a series of probabilities even though the loss is binary_crossentropy. I understand that I can …
Category: Data Science

Nested Classification in Tensorflow

I am working on a text classification problem that has an output structure that one could consider nested in the sense that similar child labels fall under the umbrella of parent labels, which are quite different. I am trying to wrap my head around a deep learning architecture that could exploit this structure to enhance predictive performance. Currently, my Tensorflow model is fairly straightforward: Input -> Fine Tuned BERT -> Dense layer -> Output with results being currently acceptable. However, …
Category: Data Science

CNN - multidimensional matrix as input or parallel input for parallel CNN

I want to run CNN on 20 channels of images. One way is to run on a 20-channel multidimensional matrix (like RGB ). Another way is to run 20 CNN on one channel at a time ( R apart from G separately from B as separate inputs ) and finally connect by concatenate What is more appropriate to do and is there a difference in the results?
Category: Data Science

Minimal example: Keras functional API & multi-input/multi-output regression

Problem: I have a regression problem, where I want to predict two or more numerical outcomes $y_i$ based on a number of numerical features $X_i$. The model would look like: $$y_{1,i}, y_{2,i} = \beta X_i + u_i.$$ I understand that the Keras functional API could be used to solve a problem like this. In an NN setting I would use ordinary densely connected layers to solve the problem. However, I have no experiance with the functional API and I'm not …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.