Coder Social home page Coder Social logo

Comments (8)

rcurtin avatar rcurtin commented on May 21, 2024

Commented by jcline3 on 13 Nov 40300065 02:13 UTC
Added a couple speed tests. Perhaps I used !ArrayList's initializers incorrectly, but it took significantly longer than std::vector to copy 1,000,000 ints.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 1 Jan 40303091 12:00 UTC
Ran the test and produced the following benchmarks:

:[ ryan @ greenstreet ]: ~ $ time ./testv

real    0m0.237s
user    0m0.136s
sys     0m0.104s
:[ ryan @ greenstreet ]: ~ $ time ./test

real    0m1.361s
user    0m1.288s
sys     0m0.076s

I think the next thing to see would be if ArrayList provides any functionality that std::vector does not, and investigate how to work around it, if it does. My concern here is our otrav mess.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by jcline3 on 25 Mar 40365780 08:00 UTC
I found one interesting use of !ArrayList in fastlib/data/dataset.cc DatasetInfo::!ReadMatrix they build an !ArrayList, linearized, and then:

matrix->Own(linearized.ReleasePtr(), n_features, n_points);
  Elem *ReleasePtr() {
    DEBUG_MODIFY_OK(this);
    cap_ = -1;
    return ptr_;
  }

Setting cap_ to -1 is supposed to indicate the !ArrayList is now an alias, it seems.

  void Own(T *in_ptr, index_t in_length) {
    DEBUG_ONLY(AssertUninitialized_());

    ptr_ = in_ptr;
    length_ = in_length;
    should_free_ = true;
  }

This does prevent you from copying the entire matrix, however, there has to be a better way. Unfortunately, we cannot just do a straight swap of the !ArrayList with std::vector since then it attempts to free it twice. Fiddling with should_free_ may prevent this, though, it may also cause a memory leak. At any rate, this should be resolvable without having to copy of the data, even it it means rewriting or adding a couple functions. I am just concerned that we may run into more of this nonsense.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 9 Aug 40881622 04:53 UTC
(In #7) Let's wait until #6 and #24 are done before reorganizing the namespaces. After a lot of that cruft has been removed, it should make this a lot easier and more intuitive.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 14 Feb 41684598 16:20 UTC
(In #47) Because this is not compiled into MLPACK until sparse support is added, it is no longer blocking other tickets.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 4 Sep 41684615 03:04 UTC
(In #49) I am working on this, but because it is commented out of the build, it is not blocking #6 or #24.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 17 Jan 41684617 10:40 UTC
(In #40) This does not block #6 or #24.

from mlpack.

rcurtin avatar rcurtin commented on May 21, 2024

Commented by rcurtin on 22 Dec 41684618 14:20 UTC
ArrayList is gone forever. Now, we can use more sensible objects instead. Hooray!

from mlpack.

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.