Giter Club home page Giter Club logo

Comments (4)

jwijffels avatar jwijffels commented on June 15, 2024

code seq_len(nrow(x)) is only used when splitting the data in a train/test set in https://github.com/bnosac/ETM/blob/master/R/ETM.R#L398 namely at https://github.com/bnosac/ETM/blob/master/R/ETM.R#L475
The error indicates your dtm argument has no data.

Did you check on what you were passing on to the function calls?

from etm.

tinltan avatar tinltan commented on June 15, 2024

code seq_len(nrow(x)) is only used when splitting the data in a train/test set in https://github.com/bnosac/ETM/blob/master/R/ETM.R#L398 namely at https://github.com/bnosac/ETM/blob/master/R/ETM.R#L475 The error indicates your dtm argument has no data.

Did you check on what you were passing on to the function calls?

Thank you, I will work on your query and input above.

Earlier, though, I changed my dataset to a little bit more data, which resulted to these dimensions:

dim(dtm)
[1] 190 31
dim(embeddings)
[1] 31 25

After entering this command: loss <- model$fit(data = dtm, optimizer = optimizer, epoch = 20, batch_size = 1000), the prior error did not come out. But I got this new error instead:

Error in Tensor_slice_put(tensor$ptr, environment(), value, mask = .d) :
rhs must be a torch_tensor or scalar value.

I will review the R code as well...

from etm.

jwijffels avatar jwijffels commented on June 15, 2024
  • Check on your input data of dtm and embeddings. Make sure there are no NA values in embeddings due to mismatch between embedding matrix and document term matrix
  • Think twice before applying this model on merely 190 text records which is just not what this model is built for

from etm.

tinltan avatar tinltan commented on June 15, 2024
  • Check on your input data of dtm and embeddings. Make sure there are no NA values in embeddings due to mismatch between embedding matrix and document term matrix
  • Think twice before applying this model on merely 190 text records which is just not what this model is built for

I tried the algorithm on the 20 newsgroups dataset, and it worked smoothly! (Just had a ggrepel warning saying "10 unlabeled data points (too many overlaps). Consider increasing max.overlaps.")

I will look for a larger dataset than the one I'm using. I will also look into the NA values in embeddings for the previous dataset. These may be the sources of the original error I had been encountering.

I will also try the other suggested plots in pythonrepo. Thank you very much for your great help! 👍 👍 👍

from etm.

Related Issues (10)

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.