Coder Social home page Coder Social logo

Comments (4)

HimaVarsha94 avatar HimaVarsha94 commented on June 17, 2024 2

@mn73 The code internally maps classes starting from 0 only. It is essential for you to start with 0 as for this code, it is the right approach.

from cnn_sentence.

youngia avatar youngia commented on June 17, 2024

The same error happens to me. After setting hidden_unites=[100,2] to [100,x], x is the number of classes, it works fine.

from cnn_sentence.

lenhhoxung86 avatar lenhhoxung86 commented on June 17, 2024

Hello, I have the same problem. I have 4 classes and I've changed the method "build_data_cv" to create the data with 4 classes. In particular:
datum = {"y":class_number, "text": orig_rev, "num_words": len(orig_rev.split()), "split": np.random.randint(0,cv)}
I've changed hidden_units as you suggested, too. However, it still threw that error. Could you please help?

from cnn_sentence.

mn73 avatar mn73 commented on June 17, 2024

I applied the code to a dataset with 5 classes, changing hidden_units to [100,5] worked. But there's another issue that puzzled me: The model behaves quite differently depending on the output labels. Having '2,4,5,6,9' as labels, the model performs really badly and the training performance sometimes alternates between two values or has the exact same value for all epochs. So, I mapped my classes to labels '0,1,2,3,4', and the performance is much better and the strange behavior disappeared. Why is that?

from cnn_sentence.

Related Issues (20)

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.