Code Monkey home page Code Monkey logo

rmdl's Introduction

DOI Best Pypi arxiv Download werckerstatus appveyor BuildStatus Join the chat at https://gitter.im/RMDL-Random-Multimodel-Deep-Learning PowerPoint researchgate Binder GitHublicense twitter

Referenced paper : RMDL: Random Multimodel Deep Learning for Classification

Referenced paper : An Improvement of Data Classification Using Random Multimodel Deep Learning (RMDL)

Random Multimodel Deep Learning (RMDL):

A new ensemble, deep learning approach for classification. Deep learning models have achieved state-of-the-art results across many domains. RMDL solves the problem of finding the best deep learning structure and architecture while simultaneously improving robustness and accuracy through ensembles of deep learning architectures. RDML can accept as input a variety data to include text, video, images, and symbolic.

RMDL

Random Multimodel Deep Learning (RDML) architecture for classification. RMDL includes 3 Random models, oneDNN classifier at left, one Deep CNN classifier at middle, and one Deep RNN classifier at right (each unit could be LSTMor GRU).

Installation

There are pip and git for RMDL installation:

Using pip

pip install RMDL

Using git

git clone --recursive https://github.com/kk7nc/RMDL.git

The primary requirements for this package are Python 3 with Tensorflow. The requirements.txt file contains a listing of the required Python packages; to install all requirements, run the following:

pip -r install requirements.txt

Or

pip3  install -r requirements.txt

Or:

conda install --file requirements.txt

Documentation:

The exponential growth in the number of complex datasets every year requires more enhancement in machine learning methods to provide robust and accurate data classification. Lately, deep learning approaches have been achieved surpassing results in comparison to previous machine learning algorithms on tasks such as image classification, natural language processing, face recognition, and etc. The success of these deep learning algorithms relys on their capacity to model complex and non-linear relationships within data. However, finding the suitable structure for these models has been a challenge for researchers. This paper introduces Random Multimodel Deep Learning (RMDL): a new ensemble, deep learning approach for classification. RMDL solves the problem of finding the best deep learning structure and architecture while simultaneously improving robustness and accuracy through ensembles of deep learning architectures. In short, RMDL trains multiple models of Deep Neural Network (DNN), Convolutional Neural Network (CNN) and Recurrent Neural Network (RNN) in parallel and combines their results to produce better result of any of those models individually. To create these models, each deep learning model has been constructed in a random fashion regarding the number of layers and nodes in their neural network structure. The resulting RDML model can be used for various domains such as text, video, images, and symbolic. In this Project, we describe RMDL model in depth and show the results for image and text classification as well as face recognition. For image classification, we compared our model with some of the available baselines using MNIST and CIFAR-10 datasets. Similarly, we used four datasets namely, WOS, Reuters, IMDB, and 20newsgroup and compared our results with available baselines. Web of Science (WOS) has been collected by authors and consists of three sets~(small, medium and large set). Lastly, we used ORL dataset to compare the performance of our approach with other face recognition methods. These test results show that RDML model consistently outperform standard methods over a broad range of data types and classification problems.

Datasets for RMDL:

Text Datasets:

  • IMDB Dataset
    • This dataset contains 50,000 documents with 2 categories.
  • Reters-21578 Dataset
    • This dataset contains 21,578 documents with 90 categories.
  • 20Newsgroups Dataset
    • This dataset contains 20,000 documents with 20 categories.
  • Web of Science Dataset (DOI: 10.17632/9rw3vkcfy4.2)
    • Web of Science Dataset WOS-11967
      • This dataset contains 11,967 documents with 35 categories which include 7 parents categories.
    • Web of Science Dataset WOS-46985
      • This dataset contains 46,985 documents with 134 categories which include 7 parents categories.
    • Web of Science Dataset WOS-5736
      • This dataset contains 5,736 documents with 11 categories which include 3 parents categories.

Image datasets:

  • MNIST Dataset
    • The MNIST database contains 60,000 training images and 10,000 testing images.
  • CIFAR-10 Dataset
    • The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images.

Face Recognition

The Database of Faces (The Olivetti Faces Dataset)

  • The The Database of Faces dataset consists of 400 92x112 colour images and grayscale in 40 person

Requirements for RMDL :

General:

GPU (if you want to run on GPU):

Text and Document Classification

  • Download GloVe: Global Vectors for Word Representation Instruction Documents
    • Set data directory into Global.py
    • if you are not setting GloVe directory, GloVe will be downloaded

Parameters:

Text_Classification

from RMDL import RMDL_Text
Text_Classification(x_train, y_train, x_test,  y_test, batch_size=128,
                 EMBEDDING_DIM=50,MAX_SEQUENCE_LENGTH = 500, MAX_NB_WORDS = 75000,
                 GloVe_dir="", GloVe_file = "glove.6B.50d.txt",
                 sparse_categorical=True, random_deep=[3, 3, 3], epochs=[500, 500, 500],  plot=True,
                 min_hidden_layer_dnn=1, max_hidden_layer_dnn=8, min_nodes_dnn=128, max_nodes_dnn=1024,
                 min_hidden_layer_rnn=1, max_hidden_layer_rnn=5, min_nodes_rnn=32,  max_nodes_rnn=128,
                 min_hidden_layer_cnn=3, max_hidden_layer_cnn=10, min_nodes_cnn=128, max_nodes_cnn=512,
                 random_state=42, random_optimizor=True, dropout=0.05):

Input

  • x_train
  • y_train
  • x_test
  • y_test

batch_size

  • batch_size: Integer. Number of samples per gradient update. If unspecified, it will default to 128.

EMBEDDING_DIM

  • batch_size: Integer. Shape of word embedding (this number should be same with GloVe or other pre-trained embedding techniques that be used), it will default to 50 that used with pain of glove.6B.50d.txt file.

MAX_SEQUENCE_LENGTH

  • MAX_SEQUENCE_LENGTH: Integer. Maximum length of sequence or document in datasets, it will default to 500.

MAX_NB_WORDS

  • MAX_NB_WORDS: Integer. Maximum number of unique words in datasets, it will default to 75000.

GloVe_dir

  • GloVe_dir: String. Address of GloVe or any pre-trained directory, it will default to null which glove.6B.zip will be download.

GloVe_file

  • GloVe_dir: String. Which version of GloVe or pre-trained word emending will be used, it will default to glove.6B.50d.txt.
  • NOTE: if you use other version of GloVe EMBEDDING_DIM must be same dimensions.

sparse_categorical

  • sparse_categorical: bool. When target's dataset is (n,1) should be True, it will default to True.

random_deep

  • random_deep: Integer [3]. Number of ensembled model used in RMDL random_deep[0] is number of DNN, random_deep[1] is number of RNN, random_deep[0] is number of CNN, it will default to [3, 3, 3].

epochs

  • epochs: Integer [3]. Number of epochs in each ensembled model used in RMDL epochs[0] is number of epochs used in DNN, epochs[1] is number of epochs used in RNN, epochs[0] is number of epochs used in CNN, it will default to [500, 500, 500].

plot

  • plot: bool. True: shows confusion matrix and accuracy and loss

min_hidden_layer_dnn

  • min_hidden_layer_dnn: Integer. Lower Bounds of hidden layers of DNN used in RMDL, it will default to 1.

max_hidden_layer_dnn

  • max_hidden_layer_dnn: Integer. Upper bounds of hidden layers of DNN used in RMDL, it will default to 8.

min_nodes_dnn

  • min_nodes_dnn: Integer. Lower bounds of nodes in each layer of DNN used in RMDL, it will default to 128.

max_nodes_dnn

  • max_nodes_dnn: Integer. Upper bounds of nodes in each layer of DNN used in RMDL, it will default to 1024.

min_hidden_layer_rnn

  • min_hidden_layer_rnn: Integer. Lower Bounds of hidden layers of RNN used in RMDL, it will default to 1.

max_hidden_layer_rnn

  • man_hidden_layer_rnn: Integer. Upper Bounds of hidden layers of RNN used in RMDL, it will default to 5.

min_nodes_rnn

  • min_nodes_rnn: Integer. Lower bounds of nodes (LSTM or GRU) in each layer of RNN used in RMDL, it will default to 32.

max_nodes_rnn

  • max_nodes_rnn: Integer. Upper bounds of nodes (LSTM or GRU) in each layer of RNN used in RMDL, it will default to 128.

min_hidden_layer_cnn

  • min_hidden_layer_cnn: Integer. Lower Bounds of hidden layers of CNN used in RMDL, it will default to 3.

max_hidden_layer_cnn

  • max_hidden_layer_cnn: Integer. Upper Bounds of hidden layers of CNN used in RMDL, it will default to 10.

min_nodes_cnn

  • min_nodes_cnn: Integer. Lower bounds of nodes (2D convolution layer) in each layer of CNN used in RMDL, it will default to 128.

max_nodes_cnn

  • min_nodes_cnn: Integer. Upper bounds of nodes (2D convolution layer) in each layer of CNN used in RMDL, it will default to 512.

random_state

  • random_state : Integer, RandomState instance or None, optional (default=None)
    • If Integer, random_state is the seed used by the random number generator;

random_optimizor

  • random_optimizor : bool, If False, all models use adam optimizer. If True, all models use random optimizers. it will default to True

dropout

  • dropout: Float between 0 and 1. Fraction of the units to drop for the linear transformation of the inputs.

Image_Classification

from RMDL import RMDL_Image
Image_Classification(x_train, y_train, x_test, y_test, shape, batch_size=128,
                         sparse_categorical=True, random_deep=[3, 3, 3], epochs=[500, 500, 500], plot=True,
                         min_hidden_layer_dnn=1, max_hidden_layer_dnn=8, min_nodes_dnn=128, max_nodes_dnn=1024,
                         min_hidden_layer_rnn=1, max_hidden_layer_rnn=5, min_nodes_rnn=32, max_nodes_rnn=128,
                         min_hidden_layer_cnn=3, max_hidden_layer_cnn=10, min_nodes_cnn=128, max_nodes_cnn=512,
                         random_state=42, random_optimizor=True, dropout=0.05)

Input

  • x_train
  • y_train
  • x_test
  • y_test

shape

  • shape: np.shape . shape of image. The most common situation would be a 2D input with shape (batch_size, input_dim).

batch_size

  • batch_size: Integer. Number of samples per gradient update. If unspecified, it will default to 128.

sparse_categorical

  • sparse_categorical: bool. When target's dataset is (n,1) should be True, it will default to True.

random_deep

  • random_deep: Integer [3]. Number of ensembled model used in RMDL random_deep[0] is number of DNN, random_deep[1] is number of RNN, random_deep[0] is number of CNN, it will default to [3, 3, 3].

epochs

  • epochs: Integer [3]. Number of epochs in each ensembled model used in RMDL epochs[0] is number of epochs used in DNN, epochs[1] is number of epochs used in RNN, epochs[0] is number of epochs used in CNN, it will default to [500, 500, 500].

plot

  • plot: bool. True: shows confusion matrix and accuracy and loss

min_hidden_layer_dnn

  • min_hidden_layer_dnn: Integer. Lower Bounds of hidden layers of DNN used in RMDL, it will default to 1.

max_hidden_layer_dnn

  • max_hidden_layer_dnn: Integer. Upper bounds of hidden layers of DNN used in RMDL, it will default to 8.

min_nodes_dnn

  • min_nodes_dnn: Integer. Lower bounds of nodes in each layer of DNN used in RMDL, it will default to 128.

max_nodes_dnn

  • max_nodes_dnn: Integer. Upper bounds of nodes in each layer of DNN used in RMDL, it will default to 1024.

min_nodes_rnn

  • min_nodes_rnn: Integer. Lower bounds of nodes (LSTM or GRU) in each layer of RNN used in RMDL, it will default to 32.

max_nodes_rnn

  • maz_nodes_rnn: Integer. Upper bounds of nodes (LSTM or GRU) in each layer of RNN used in RMDL, it will default to 128.

min_hidden_layer_cnn

  • min_hidden_layer_cnn: Integer. Lower Bounds of hidden layers of CNN used in RMDL, it will default to 3.

max_hidden_layer_cnn

  • max_hidden_layer_cnn: Integer. Upper Bounds of hidden layers of CNN used in RMDL, it will default to 10.

min_nodes_cnn

  • min_nodes_cnn: Integer. Lower bounds of nodes (2D convolution layer) in each layer of CNN used in RMDL, it will default to 128.

max_nodes_cnn

  • min_nodes_cnn: Integer. Upper bounds of nodes (2D convolution layer) in each layer of CNN used in RMDL, it will default to 512.

random_state

  • random_state : Integer, RandomState instance or None, optional (default=None)
    • If Integer, random_state is the seed used by the random number generator;

random_optimizor

  • random_optimizor : bool, If False, all models use adam optimizer. If True, all models use random optimizers. it will default to True

dropout

  • dropout: Float between 0 and 1. Fraction of the units to drop for the linear transformation of the inputs.

Example

MNIST

  • The MNIST database contains 60,000 training images and 10,000 testing images.

Import Packages

from keras.datasets import mnist
import numpy as np
from RMDL import RMDL_Image as RMDL

Load Data

(X_train, y_train), (X_test, y_test) = mnist.load_data()
X_train_D = X_train.reshape(X_train.shape[0], 28, 28, 1).astype('float32')
X_test_D = X_test.reshape(X_test.shape[0], 28, 28, 1).astype('float32')
X_train = X_train_D / 255.0
X_test = X_test_D / 255.0
number_of_classes = np.unique(y_train).shape[0]
shape = (28, 28, 1)

Using RMDL

batch_size = 128
sparse_categorical = 0
n_epochs = [100, 100, 100]  ## DNN-RNN-CNN
Random_Deep = [3, 3, 3]  ## DNN-RNN-CNN

RMDL.Image_Classification(X_train, y_train, X_test, y_test,shape,
                     batch_size=batch_size,
                     sparse_categorical=True,
                     random_deep=Random_Deep,
                     epochs=n_epochs)

IMDB

  • This dataset contains 50,000 documents with 2 categories.

Import Packages

import sys
import os
from RMDL import text_feature_extraction as txt
from keras.datasets import imdb
import numpy as np
from RMDL import RMDL_Text as RMDL

Load Data

print("Load IMDB dataset....")
(X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=MAX_NB_WORDS)
print(len(X_train))
print(y_test)
word_index = imdb.get_word_index()
index_word = {v: k for k, v in word_index.items()}
X_train = [txt.text_cleaner(' '.join(index_word.get(w) for w in x)) for x in X_train]
X_test = [txt.text_cleaner(' '.join(index_word.get(w) for w in x)) for x in X_test]
X_train = np.array(X_train)
X_train = np.array(X_train).ravel()
print(X_train.shape)
X_test = np.array(X_test)
X_test = np.array(X_test).ravel()

Using RMDL

batch_size = 100
sparse_categorical = 0
n_epochs = [100, 100, 100]  ## DNN--RNN-CNN
Random_Deep = [3, 3, 3]  ## DNN--RNN-CNN

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                     batch_size=batch_size,
                     sparse_categorical=sparse_categorical,
                     random_deep=Random_Deep,
                     epochs=n_epochs)

Web Of Science

  • Linke of dataset: Data
    • Web of Science Dataset WOS-11967
      • This dataset contains 11,967 documents with 35 categories which include 7 parents categories.
    • Web of Science Dataset WOS-46985
      • This dataset contains 46,985 documents with 134 categories which include 7 parents categories.
    • Web of Science Dataset WOS-5736
      • This dataset contains 5,736 documents with 11 categories which include 3 parents categories.

Import Packages

from RMDL import text_feature_extraction as txt
from sklearn.model_selection import train_test_split
from RMDL.Download import Download_WOS as WOS
import numpy as np
from RMDL import RMDL_Text as RMDL

Load Data

path_WOS = WOS.download_and_extract()
fname = os.path.join(path_WOS,"WebOfScience/WOS11967/X.txt")
fnamek = os.path.join(path_WOS,"WebOfScience/WOS11967/Y.txt")
with open(fname, encoding="utf-8") as f:
    content = f.readlines()
    content = [txt.text_cleaner(x) for x in content]
with open(fnamek) as fk:
    contentk = fk.readlines()
contentk = [x.strip() for x in contentk]
Label = np.matrix(contentk, dtype=int)
Label = np.transpose(Label)
np.random.seed(7)
print(Label.shape)
X_train, X_test, y_train, y_test = train_test_split(content, Label, test_size=0.2, random_state=4)

Using RMDL

batch_size = 100
sparse_categorical = 0
n_epochs = [5000, 500, 500]  ## DNN--RNN-CNN
Random_Deep = [3, 3, 3]  ## DNN--RNN-CNN

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                     batch_size=batch_size,
                     sparse_categorical=True,
                     random_deep=Random_Deep,
                     epochs=n_epochs,no_of_classes=12)

Reuters-21578

  • This dataset contains 21,578 documents with 90 categories.

Import Packages

import sys
import os
import nltk
nltk.download("reuters")
from nltk.corpus import reuters
from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
from RMDL import RMDL_Text as RMDL

Load Data

documents = reuters.fileids()

train_docs_id = list(filter(lambda doc: doc.startswith("train"),
                          documents))
test_docs_id = list(filter(lambda doc: doc.startswith("test"),
                         documents))
X_train = [(reuters.raw(doc_id)) for doc_id in train_docs_id]
X_test = [(reuters.raw(doc_id)) for doc_id in test_docs_id]
mlb = MultiLabelBinarizer()
y_train = mlb.fit_transform([reuters.categories(doc_id)
                           for doc_id in train_docs_id])
y_test = mlb.transform([reuters.categories(doc_id)
                      for doc_id in test_docs_id])
y_train = np.argmax(y_train, axis=1)
y_test = np.argmax(y_test, axis=1)

Using RMDL

batch_size = 100
sparse_categorical = 0
n_epochs = [20, 500, 50]  ## DNN--RNN-CNN
Random_Deep = [3, 0, 0]  ## DNN--RNN-CNN

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
             batch_size=batch_size,
             sparse_categorical=True,
             random_deep=Random_Deep,
             epochs=n_epochs)

Olivetti Faces

  • There are ten different images of each of 40 distinct subjects. For some subjects, the images were taken at different times, varying the lighting, facial expressions (open / closed eyes, smiling / not smiling) and facial details (glasses / no glasses). All the images were taken against a dark homogeneous background with the subjects in an upright, frontal position (with tolerance for some side movement).

Import Packages

from sklearn.datasets import fetch_olivetti_faces
from sklearn.model_selection import train_test_split
from RMDL import RMDL_Image as RMDL

Load Data

number_of_classes = 40
shape = (64, 64, 1)
data = fetch_olivetti_faces()
X_train, X_test, y_train, y_test = train_test_split(data.data,
                                              data.target, stratify=data.target, test_size=40)
X_train = X_train.reshape(X_train.shape[0], 64, 64, 1).astype('float32')
X_test = X_test.reshape(X_test.shape[0], 64, 64, 1).astype('float32')

Using RMDL

batch_size = 100
sparse_categorical = 0
n_epochs = [500, 500, 50]  ## DNN--RNN-CNN
Random_Deep = [0, 0, 1]  ## DNN--RNN-CNN

RMDL.Image_Classification(X_train, y_train, X_test, y_test,
                      shape,
                      random_optimizor=False,
                      batch_size=batch_size,
                      random_deep=Random_Deep,
                      epochs=n_epochs)

More Example link

Results

Error and Comments:

Send an email to [email protected]

Citations

@inproceedings{Kowsari2018RMDL,
     author = {Kowsari, Kamran and Heidarysafa, Mojtaba and Brown, Donald E. and Meimandi, Kiana Jafari and Barnes, Laura E.},
     title = {RMDL: Random Multimodel Deep Learning for Classification},
     booktitle = {Proceedings of the 2Nd International Conference on Information System and Data Mining},
     series = {ICISDM '18},
     year = {2018},
     isbn = {978-1-4503-6354-9},
     location = {Lakeland, FL, USA},
     pages = {19--28},
     numpages = {10},
     url = {http://doi.acm.org/10.1145/3206098.3206111},
     doi = {10.1145/3206098.3206111},
     acmid = {3206111},
     publisher = {ACM},
     address = {New York, NY, USA},
     keywords = {Data Mining, Deep Learning, Deep Neural Networks, Image Classification, Supervised Learning, Text Classification},
    } 

and

@article{Heidarysafa2018RMDL,
title={An Improvement of Data Classification Using Random Multimodel Deep Learning (RMDL)},
author={Heidarysafa, Mojtaba and Kowsari, Kamran and Brown, Donald E. and Jafari Meimandi, Kiana and Barnes, Laura E.},
booktitle={International Journal of Machine Learning and Computing (IJMLC)},
year={2018},
Volume={8},
Number={4},
pages={298--310},
DOI={https://doi.org/10.18178/ijmlc.2018.8.4.703}
}

rmdl's People

Contributors

heidarysafa avatar ikiana avatar kamykowsari avatar kk7nc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rmdl's Issues

How to use a trained model for predictions?

Hello,

Your approach looks very interesting and I would like to test it on my own research. I've skimmed through the docs, readme and source code without finding an answer to this issue:

Once a model is trained, is there a way to save it as a file for future use? If so, how would you then reload it and use it to do predictions on new unlabelled data?

Describe the solution you'd like

Ideally, simple methods such as save_model() , load_model() and predict(), similar to what's already available on e.g. Keras or Scikit-Learn

accuracy question

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

random_optimier not use

Hi.
I reproduced your code with PyTorch, but when I reviewed the code, I found that you didn't use random_optimizer when sorting images with CNN, but Adam instead.

Prediction time

Hi, very interesting approach.
Can you provide some estimates of time performance for predict image classification.
For example how much time takes to predict 28x28 RGB image, it will be great to see comparison by VGG16
Thanks

Functional API

I found this library really helpful to my task of text classification, so thanks for turning it available. I would like to use other variables beside the text, though, as I can usually use in a Functional API model from Keras. Is it possible for me to make the changes necessary to apply this feature?

Upload Trained Model

Hello, could you upload an already trained network such that one could use and test it without the time consuming training phase? This would be really great!

Multi label classifier in RMDL.

Problem Statement
The problem I am solving is to classify genres of movies. So, the output in my case would be one-hot encoded for 20 genres(array of 20 elements with 1 or 0). For this we are using loss function of binary_crossentropy and sigmoid as the last layer activation.

Describe the solution you'd like
We would like to have an option of binary_crossentropy=True in parameters, and also number_of_classes should be configurable and not np.max(y_train)+1 which would always be 2 in my case.

Describe alternatives you've considered
No alternatives have been considered for now.

Unseen data...

Hi

If I use RMDL and I want to predict unseen data, could I use predict function?
if yes, how?

Thanks

ValueError

First of all thank you so much for your efforts in this paper, it is very interesting. But when I tried to run the code for text classification I got this error ("ValueError: max_features=[20, 500, 50], neither a positive integer nor None"). This error occurs when I run [RMDL.Text_Classification(X_train, y_train, X_test, y_test, batch_size, sparse_categorical, Random_Deep, n_epochs]. So can you please help me to overcome that.

Regards,
Saja

How to set the number of "n" in the experiment?

Hello.I am very interested in this paper.I want to do some research in image classification in my own datasets,but i don't know how to set the n : Random_Deep = [3, 0, 3] ## DNN--RNN-CNN.
Does this value n set at random?

Could not find %s Set GloVe Directory in Global.py

I am getting the following error while executing the following code.

from RMDL import RMDL_Text

text_classification=RMDL_Text.Text_Classification(Xtrain,Ytrain,Xtest,Ytest)
Could not find %s Set GloVe Directory in Global.py  <module 'RMDL.Download.Download_Glove' from 'C:\\Users\\Veni\\Anaconda3\\lib\\site-packages\\RMDL\\Download\\Download_Glove.py'>
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-22-a2b7412e3f8f> in <module>()
      1 from RMDL import RMDL_Text
      2 
----> 3 text_classification=RMDL_Text.Text_Classification(Xtrain,Ytrain,Xtest,Ytest)

~\Anaconda3\lib\site-packages\RMDL\RMDL_Text.py in Text_Classification(x_train, y_train, x_test, y_test, batch_size, EMBEDDING_DIM, MAX_SEQUENCE_LENGTH, MAX_NB_WORDS, GloVe_dir, GloVe_file, sparse_categorical, random_deep, epochs, plot, min_hidden_layer_dnn, max_hidden_layer_dnn, min_nodes_dnn, max_nodes_dnn, min_hidden_layer_rnn, max_hidden_layer_rnn, min_nodes_rnn, max_nodes_rnn, min_hidden_layer_cnn, max_hidden_layer_cnn, min_nodes_cnn, max_nodes_cnn, random_state, random_optimizor, dropout)
     56         if not os.path.isfile(GloVe_DIR):
     57             print("Could not find %s Set GloVe Directory in Global.py ", GloVe)
---> 58             exit()
     59 
     60     G.setup()

NameError: name 'exit' is not defined

Error in model 0 try to re-generate an other model DNN 0

I have an Image Data Set with dimensions 21x32x1. When I feed it into the model as described in the README.md i get this error. I have gone through all the previous threads related to this issue but it didn't solve my problem. My model never runs, it straight away throws this error.
Please guide me on how to solve it!

Can i use it with speech?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Error in model 0 try to re-generate an other model DNN 0

""Epoch 00001: val_acc improved from -inf to 0.76482, saving model to weights\weights_DNN_0.hdf5
Error in model 0 try to re-generate another model
DNN 0
<keras.optimizers.Adagrad object at 0x7f3339451dd8>
Train on 7769 samples, validate on 3019 samples
Epoch 1/120
Segmentation fault (core dumped)""
this appear when i start to run any examples.

This problem asked at kk7nc/HDLTex#5

accurcy problems

Hello !
When I do some experiment on my own datasets according to your model,why the value of acc in some model is always 0.1000 from the begging to the end??
Thanks!

"""
batch_size = 100
sparse_categorical = 0
n_epochs = [200, 200, 300] ## DNN--RNN-CNN [500, 500, 500]
Random_Deep = [2, 2, 3] ## DNN--RNN-CNN
......
Epoch 00277: val_acc did not improve from 0.10000
Epoch 278/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00278: val_acc did not improve from 0.10000
Epoch 279/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00279: val_acc did not improve from 0.10000
Epoch 280/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00280: val_acc did not improve from 0.10000
Epoch 281/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00281: val_acc did not improve from 0.10000
Epoch 282/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00282: val_acc did not improve from 0.10000
Epoch 283/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00283: val_acc did not improve from 0.10000
Epoch 284/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00284: val_acc did not improve from 0.10000
Epoch 285/300

  • 81s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00285: val_acc did not improve from 0.10000
Epoch 286/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00286: val_acc did not improve from 0.10000
Epoch 287/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00287: val_acc did not improve from 0.10000
Epoch 288/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00288: val_acc did not improve from 0.10000
Epoch 289/300

  • 81s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00289: val_acc did not improve from 0.10000
Epoch 290/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00290: val_acc did not improve from 0.10000
Epoch 291/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00291: val_acc did not improve from 0.10000
Epoch 292/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00292: val_acc did not improve from 0.10000
Epoch 293/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00293: val_acc did not improve from 0.10000
Epoch 294/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00294: val_acc did not improve from 0.10000
Epoch 295/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00295: val_acc did not improve from 0.10000
Epoch 296/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00296: val_acc did not improve from 0.10000
Epoch 297/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00297: val_acc did not improve from 0.10000
Epoch 298/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00298: val_acc did not improve from 0.10000
Epoch 299/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00299: val_acc did not improve from 0.10000
Epoch 300/300

  • 80s - loss: 14.5063 - acc: 0.1000 - val_loss: 14.5063 - val_acc: 0.1000

Epoch 00300: val_acc did not improve from 0.10000
(3000, 7)
(3000, 7)
Accuracy of 7 models: [0.485, 0.1, 0.718, 0.7346666666666667, 0.1, 0.6653333333333333, 0.1]
Accuracy: 0.6853333333333333
F1_Micro: 0.6853333333333333
F1_Macro: 0.6642739238169832
F1_weighted: 0.6642739238169834

Process finished with exit code 0
"""

Text classification task accuracy problem

Hello, I am very interested in your article--An Improvement of Data Classification Using Random Multimodel Deep Learning (RMDL)
However, during the experiment, I found that the reproducibility accuracy of the four data sets WOS11967, WOS46985, IMDB and 20NewsGroup differed greatly. Is there any other information that needs attention besides the information published by github?
Looking forward to your guidance, thank you~

How to we make prediction on new data?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.