karpathy / char-rnn

Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch
11.52k stars 2.58k forks source link

Character classification - rnn using LSTM #210

Open vijayzutshi opened 6 years ago

vijayzutshi commented 6 years ago

HI,

I am using LSTM to build a character classification model. I have also taken idea from your code too. I am able to build a model and infer model using following codes:-

model <- mx.lstm(X.train, X.val, ctx=mx.cpu(), num.round=num.round, update.period=update.period, num.lstm.layer=num.lstm.layer, seq.len=seq.len, num.hidden=num.hidden, num.embed=num.embed, num.label=vocab, batch.size=batch.size, input.size=vocab, initializer=mx.init.uniform(0.01), learning.rate=learning.rate, wd=wd, optimizer = "sgd", clip_gradient=clip_gradient)

infer.model <- mx.lstm.inference(num.lstm.layer=num.lstm.layer, input.size=vocab, num.hidden=num.hidden, num.embed=num.embed, num.label=vocab, arg.params=model$arg.params, ctx=mx.cpu())

Now what I want to do is to find the accuracy of the model using R with ROC curve. I would really appreciate if you or someone can provide me with a code in R to do that. Your help will be really appreciated as I not able to figure out as to the procedure or code.

Thanks Vijay Zutshi