Giter Site home page Giter Site logo

tests for weight optimization about brush HOT 7 CLOSED

cavalab avatar cavalab commented on August 11, 2024
tests for weight optimization

from brush.

Comments (7)

gAldeia avatar gAldeia commented on August 11, 2024 1

The python binding installation is working like a charm!! I am planning to do the tests in python (in the future I can replicate them for the C++ version).

I managed to get nose to work, but that required manual configurations. I found that nose is no longer maintained. Its successor, nose2, encourages migrating to pytest (I have used this one in the past, so I am familiar with it).

I am going to rewrite previous tests, then implement new ones with the pytest testing framework.

from brush.

gAldeia avatar gAldeia commented on August 11, 2024

Hello William,

I have some questions regarding coefficient optimization.

As far as I understood, if the node has is_weighted=true, then the weights are applied to each of its children. A weighted sqrt would be equivalent to sqrt(w*<child>).

I was trying to somehow add and adjust external weights as well. My question is: in order to have an external weight (such as w2*sqrt(w*<child>)), then the parent of sqrt should be a node with is_weighted set to true as well? Or the weight could explicitly be created by multiplying a constant node with sqrt(...)?

Also, do constant nodes have its values fixed, or they can be adjusted through optimization as well? I have tried to create constant nodes manually by using your json parser, but I didn't managed to get it working.

Regarding organization:

  • Should I test every operator? (if so, is that ok to populate /docs/examples/datasets/ with generated files, or it is better to have it hardcored in the tests?)
  • I'm thinking about separating the optimization tests into an individual file, is that ok?

from brush.

lacava avatar lacava commented on August 11, 2024

Hello William,

I have some questions regarding coefficient optimization.

As far as I understood, if the node has is_weighted=true, then the weights are applied to each of its children. A weighted sqrt would be equivalent to sqrt(w*<child>).

Yes that's right! This is a design choice that we might want to revisit. I set it up this way to make backpropagation easier, but now that ceres is handling weight updates, we could put the weights anywhere.

I was trying to somehow add and adjust external weights as well. My question is: in order to have an external weight (such as w2*sqrt(w*<child>)), then the parent of sqrt should be a node with is_weighted set to true as well? Or the weight could explicitly be created by multiplying a constant node with sqrt(...)?

Yes, that's correct.

Also, do constant nodes have its values fixed, or they can be adjusted through optimization as well? I have tried to create constant nodes manually by using your json parser, but I didn't managed to get it working.

I have not spend enough time on the Constants, they need to be developed. Let me know what is happening. We should probably prioritize getting them working.

Regarding organization:

  • Should I test every operator? (if so, is that ok to populate /docs/examples/datasets/ with generated files, or it is better to have it hardcored in the tests?)
  • I'm thinking about separating the optimization tests into an individual file, is that ok?

Maybe it's better to hard code the tests rather than have a lot of data files.

Also, if it's easier you can now write the tests in Python using the pybind11 bindings:

def test_json_regressor(self):

from brush.

lacava avatar lacava commented on August 11, 2024

from brush.

lacava avatar lacava commented on August 11, 2024

hey @gAldeia , I made a change to reorder the constants so that they are applied to the outside of the operators. It's on this branch; https://github.com/cavalab/brush/tree/reorder_constants

I think we should go with that going forward. Could you incorporate this into the tests you've written?

from brush.

gAldeia avatar gAldeia commented on August 11, 2024

Hello @lacava! I think this modification is clear to me. Function nodes still have weights, but terminal nodes can have coefficients now. I will work on adjusting the tests!

from brush.

gAldeia avatar gAldeia commented on August 11, 2024

Hi @lacava! During our meeting, I mentioned that I wasn't able to build the docs.

I think this is a problem on my machine, since the GitHub job managed to successfully compile the docs and execute the tests.

from brush.

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.