Git Product home page Git Product logo

Comments (5)

alvinwan avatar alvinwan commented on May 21, 2024

Code looks good. What's the error? You can just run the model as an NBDT. However, fine-tuning with the SoftTreeSupLoss will improve accuracy drastically.

from neural-backed-decision-trees.

akshatshreemali avatar akshatshreemali commented on May 21, 2024

Hey
thanks for your reply
everytime i try to run the code for my custom dataset
i get an "assertion error"
below is the code:
from nbdt.loss import SoftTreeSupLoss
criterion = nn.CrossEntropyLoss()
criterion = SoftTreeSupLoss(dataset=data['train'], criterion=criterion)

where data['train'] is a dataloader for my dataset

Sorry for the confusion but please let me know if i am missing anything

Error snipet:
/usr/local/lib/python3.6/dist-packages/nbdt/data/custom.py in dataset_to_dummy_classes(dataset)
31
32 def dataset_to_dummy_classes(dataset):
---> 33 assert dataset in DATASETS
34 num_classes = DATASET_TO_NUM_CLASSES[dataset]
35 return [FakeSynset.create_from_offset(i).wnid for i in range(num_classes)]

from neural-backed-decision-trees.

alvinwan avatar alvinwan commented on May 21, 2024

I see, just modify the nbdt.utils.DATASETS constant to include your custom dataset. Also, dataset section of the README will be helpful: https://github.com/alvinwan/neural-backed-decision-trees#dataset

from neural-backed-decision-trees.

akshatshreemali avatar akshatshreemali commented on May 21, 2024

Hi,
thanks a lot for your reply and time.
I modified the utils.py and modified the datasets too for my custom dataset.
However, can you guide me to execute it?
The reason being, after modifying both the python files I get the same error.
After modifying both files, is their a different way to run these files?

from neural-backed-decision-trees.

alvinwan avatar alvinwan commented on May 21, 2024

Try steps 3 and 4 (I just added these) in the README "datasets" section. It now elucidates which constants in nbdt.utils to modify.

from neural-backed-decision-trees.

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.