Comments (8)
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.
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.
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.
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.
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.
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.
Commented by rcurtin on 17 Jan 41684617 10:40 UTC
(In #40) This does not block #6 or #24.
from mlpack.
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)
- MLPACK_STRING_VIEW error HOT 13
- Inconsistent use of the "input" parameter to the Backward method in ANNs HOT 11
- Add accuracy measure for mlpack_logistic_regression ? HOT 7
- Error in use of preprocess_split() in LinearRegression. HOT 2
- Proposal for New Supervised Learning Data Simulation Classes in C++ for MLPACK Library HOT 5
- Build fail for project using MLPack, M_SQRT2 undeclared identifier HOT 4
- MPLACK failed build in x86 mode HOT 1
- msvc round in core/math/round.hpp HOT 2
- Multihead attention layer HOT 1
- Multi-head output network HOT 1
- How to configure mlpack_test?
- How to configure mlpack test case HOT 1
- RADICAL number of components HOT 2
- Documentation should make types clearer when using non-default `MatType`s
- in ver 4.3.0 I can`t import linear_svm HOT 5
- Is it possible to get the distance calculations as one of the return types in Kmeans clustering HOT 4
- mlpack / opencv namespace ambiguity? HOT 3
- benchmark results HOT 1
- make install taking a lot of time in arm low end processor (1.5 GHz clock cycle) HOT 2
- Problem in reading csv data (inconsistent dimensions) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlpack.