« first day (200 days earlier)      last day (3032 days later) » 

2:24 AM
Just a blind guess, maybe times is compiled without multi-threading support and mtimes with multi-threading support.
 
2:47 AM
@AndrasDeak I confirm
>> a=rand(5000); b=rand(5000);
timeit(@() 2*(a<b))
timeit(@() 2.*(a<b))
ans =
   0.535955810924325
ans =
   0.311133125598342
However
>> a=rand(5000); b=rand(5000);
timeit(@() 2*a)
timeit(@() 2.*a)
ans =
   0.208370801091709
ans =
   0.218047933390507
It clearly has to do with the array being logical:
a=rand(5000); b=rand(5000);
timeit(@() 2*logical(a))
timeit(@() 2.*logical(a))
ans =
   0.519554753636992
ans =
   0.273158497756247
 
 
7 hours later…
9:43 AM
@LuisMendo awesome, thanks:)
I had a hunch that being logical matters
Could you also check with uint8? It could be an integer/float thing...
 
 
2 hours later…
11:17 AM
nevermind:
There is no difference with (uint8(a)*2 vs (uint8(a).*2, but I see the same difference with c=a<b; c(:)*2 vs c(:).*2 . — x1hgg1x 1 hour ago
 
11:36 AM
@AndrasDeak - What's up? You busy? :)
 
@Dev-iL mainly with SO;) Nothing much otherwise.
And you? Having a busy Jewish Monday?;D
 
Got time to help me come up with some algo?
@AndrasDeak lol I suppose so :)
 
@Dev-iL I think so, we can try:)
worst case is I have to go help the missus cook lunch or something:D
 
Ok so I have 3 numbers: 1,2,3 ... Now I need to find the nchoosek(3,2) combinations of these numbers. I can't quite figure out how to stitch it with perms()
their order in the result is not important
 
A sure way is to keep the first two columns of perms([1,2,3]), then sort() them by rows, and keep the unique ones
there should be a more elegant one, I'll keep thinking about it:)
 
11:43 AM
This is what I thought about as a last resort :)
 
yeah
is the 3 always going to be 3?
 
yeah 0_o
 
You just have to throw away 1, then 2, then 3:)
or just set inds=[1 2; 1 3; 2 3]; v=[1,2,3]; v(inds) :D
 
@AndrasDeak haha the second you defined inds you got the desired result
 
lol:D
right
but this is more general, you can use it for v=[10 5 2];)
 
11:48 AM
I guess I'll go with the awkward perms-unique-trimming
Hello @Adriaan !
 
@Dev-iL mornin
 
@Dev-iL why?
if your problem is not general, why give a general solution?
sup @Adriaan
 
It is a bit more general but not by much
 
@AndrasDeak Not much, had a birthday in the other end of the country yesterday
 
@AndrasDeak ideally, it should work for an input vector of length up to 4 and I would need to choose 2-4 numbers
 
11:53 AM
@Dev-iL so why did you say the 3 is always going to be 3?:D
I always get the feeling that we're constantly misunderstanding each other:P
 
I thought you talked about the input value, not numel
 
@Adriaan great, happy birthday then!
oh, that far? 20 kms?;)
 
@AndrasDeak Something tells me it wasn't his b-day
 
@Dev-iL dunno
but it was probably in Amsterdam
was it?
 
@AndrasDeak 120km!
@AndrasDeak Nope, near Eindhoven
@Dev-iL And no, that's in three weeks. You're all invited!
 
12:01 PM
@Adriaan wooppieee!
however you spell that
 
in = 1:4; chooz = 1;
p = perms(in);
p2 = unique(sort(p(:,1:chooz),2),'rows');
 
will unique get the unique rows by default?
 
@AndrasDeak just values I think
unique(magic(3))

ans =

     1
     2
     3
     4
     5
     6
     7
     8
     9
 
so that's not good for you, right?
 
what I wrote solves the problem
 
12:10 PM
@AndrasDeak values. You can specify rows though
 
ooooh
crap
you exactly wrote that
I completely missed that, that's why I asked about the default behaviour:D
I'm very cognitive today as well, it would seem...
 
Just wondering if there's a better way :)
@AndrasDeak lol that's a bit of an overkill, don't you think?
http://www.mathworks.com/matlabcentral/fileexchange/24325-combinator-combinations-and-permutations
 
why not?:D
question is, is it efficient?
I don't really like external libs though
 
This should be efficient enough... Judging by the author and the fact its mex
Apparently he has a bunch of these functions for all sorts of scenarios
VChooseK (no repetitions, no order):
http://www.mathworks.com/matlabcentral/fileexchange/26190
VChooseKR (repetitions, no order):
http://www.mathworks.com/matlabcentral/fileexchange/26277
VChooseKRO (repetitions, order):
http://www.mathworks.com/matlabcentral/fileexchange/26242
 
12:27 PM
I think you're best off with the specific function you need
then you don't have additional overhead from the front-end
not that nchoosek for n=4, k=2 is so heavy:D
 
What I need is the VChooseK apparently
 
yup
 
12:46 PM
@Daniel I updated my post. Do you have any idea why only logicals show this improvement? Do you think it could be some trick by putting multiple logicals into the same byte? I don't really see why logicals should be more multi-threaded than uint8's.
 
1:16 PM
oops, you've just arrived @Daniel, sorry to spam you with the same question (here and in comments)
 
@AndrasDeak: I have no idea, it was my blind guess before knowing the difference between logical / numbers
 
@Daniel unfortunately I'm not at all familiar with such intricacies of vectorization
but I'm surprised that logicals work, uint8's don't
I only answered the question because I thought there wasn't an effect in the first place:)
 
Matlab 2015b has a totally new execution engine. It would not surprise me if it's just a dumb implementation bug which no one noticed because scalar multiplication is typically very fast.
It might be multiplication or JIT translating the multiplication to an indexing operation.
 
hmm
 
(a<b).*2 and c(a<b)=2 is basically the same
 
1:21 PM
I have been thinking about suggesting feature('jit','off') and such to OP
@Daniel but we're not doing indexing anymore
purely var=(a<b).*3.56
or whatever
oooh
nevermind, I misunderstood
I think I understand what you mean
 
It might be JIT having some special rule to detect that case
 
 
1 hour later…
2:24 PM
@AndrasDeak uint8 doesn't seem to have an influence:
>> a=randi(100,5000,5000);
timeit(@() 2*uint8(a))
timeit(@() 2.*uint8(a))
ans =
0.234352211776256
ans =
0.238603070113249

>> a=uint8(randi(100,5000));
timeit(@() 2*a)
timeit(@() 2.*a)
ans =
0.125752413415775
ans =
0.124325681804625
 
@LuisMendo thank you:)
 
3:22 PM
@ballBreaker I've just found this:
dude has a bunch of videos like this:D
 
Does somebody know how meanshift works?
I mean getting mean shift of a histogram (and maybe its backprojection)
 
4:23 PM
1
Q: How does meanshift tracking work? (using histograms)

blackI know, that the Meanshift-Algorithm calculates the mean of a pixel density and checks, if the center of the roi is equal with this point. If not, it moves the new ROI center to the mean center and checks again... . Like in this picture: For density, it is clear how to find the mean point. But...

 
 
2 hours later…
6:08 PM
@rayryeng thank you, I'm doing quite well. Not a lot of time to write code (with great responsibility comes a serious lack of time - now if they also gave me great power...), especially if I want to spend time with my family.
@rayryeng: having seen your comment about your professor: the more papers I revised, the more people I supervised, the more research proposals I wrote, the more I realized how important my professors' contribution had been to the success of the lab :)
 
6:55 PM
That makes total sense @Jonas :). I don't think any of my work led to the success of my lab though. Most of the work I did has long since been deprecated and my supervisor doesn't pursue the research that I did before.. probably because no one has that expertise that's left in my lab or he simply got tired of it.. it's a pity though.
 
7:07 PM
@flawr this is titled "When you take a physics course as a mathematician": bmeme.hu/post/5848/amikor-matematikuskent-fizikat-hallgatsz :D
 
@rayryeng: that's one of the downsides to doing research in academia - you have to pursue the research your students can/want to do, even if you may want to do something different
 
 
2 hours later…
9:41 PM
@AndrasDeak Haha, true=) Is this hungarian?
 
@flawr yup
it's a meme-posting site supported by students of my university
in mostly university-related topics
some of them could be appreciated internationally, but the language is almost exclusively Hungarian
 
Haha, cool, now I just need to learn Hungarian=)
Yes right=)
 
@flawr don't even try, it's impossible.
 
That is the impression I have too. I once tried to pick up a few words, but they had just no resemblence to any other language I knew.
 
@flawr This one: bmeme.hu/post/5867/nem-tevedett is about a horoscope saying "You're in for a surprise, intimate in nature.", and the caption is "When your horoscope tells you you're getting fucked at your exam."
@flawr it is quite unique, but words are usually managable if you're told about the alphabet (since the language itself is phonetic, so you just have to put the fourty-odd letters next to each other)
 
9:45 PM
@AndrasDeak it's less funny when you have to translate everything
 
@Adriaan yeah, much less. But this is one of the recent ones that could've been internationally relevant:P
 
@AndrasDeak Do you mean that the letters (well ignoring all those accents/symbols first) are pronounced quite differently compared to other languages?
OH
The Hungarian alphabet is an extension of the Latin alphabet used for writing the Hungarian language. One sometimes speaks of the smaller and greater Hungarian alphabets, depending on whether or not the letters Q, W, X, Y are listed, which can only be found in foreign words and traditional orthography of names. The 44 letters of the greater Hungarian alphabet are: == Description == Each sign shown above counts as a letter in its own right in Hungarian. Some, such as the letter ó and Å‘, are inter-filed with the letter preceding it when sorting words alphabetically, whereas others, such as ö, have...
I gave up half way through=)
Oh, the only words I know:
Alvin és at mókusok
 
@flawr that's positively weird. I mean, stacking an accent on a letter and calling it a different letter is mkay, but placing two completely common letters behind one another and calling it one is just invented to piss people off
 
> but placing two completely common letters behind one another and calling it one is just invented to piss people off
=)
 
@flawr They don't even have a separate keyboard key to make stuff like "Zs", as those are two distinct letters... talk about making stuff difficult just to make it difficult
 
9:58 PM
But the language seem to be so incredibly fun!
Like russian, polish or czech!
 
@flawr no, most of our sounds are familiar from other languages: I think a lot are similar to the German ones, softened sounds like ty, ny, gy [should be dy by the way] are Slavic in origin
@flawr that's a good one!:)
@Adriaan they are two letters, but a single, distinct sound
and using those 44 (40) sounds you can produce the entire Hungarian language
you only wish you could know how to pronounce "ea" in English, regardless of context and neighbouring letters and tradition and dialect
@flawr Russian is fun;)
 
@AndrasDeak wait, you don't have dialects in Hungary?
Besides that, I get that they are different sounds and that in this way you have all 40-odd sounds that make up your language, but is it really necessary to include the double-letters in the alphabet, since they consist of two letters which already are in the alphabet?
We've got for instance the "ch" which is pronounced almost exactly as a "g", and the "ng" and "nk" combinations which have a separate pronunciation, but we don't deem it necessary to include them in our alphabet, though we might well have more distinct sounds than you folks do.
Gratz on the 6K by the bye @AndrasDeak!
anyhow, bedtime now. Good night lassies
 
10:54 PM
@flawr how did you get to know Hungarian (pop-) punk?
@Adriaan well, I did exaggerate a bit, I guess almost all languages have dialects. But I don't think we have officially recognized dialects which show as much difference as cockney, recieved pronunciation, and whatever the Irish speak, for instance
@Adriaan but Dutch is not phonetic, is it?
If some sounds sound differently based on context, you can't try to enumerate them in an alphabet
you almost certainly have more sounds than us, but here even the average Joe can count the sounds without resorting to IPA:P (no, not a beer)
we do have dz and dzs though, which are almost d+z, d+zs as sounds (though I think d+z, d+zs should have a glottal stop or something between the two respective sounds)
@Adriaan and thank you, and a belated good night!
 
11:17 PM
@AndrasDeak Someone asked me once what the (supposedly) german verse at the end means.
And I just lovd that song=)
 
@flawr ah, I see:)
yeah that's probably Germungarian;D Can be as bad as Hunglish
The song's title and chorus is "Julia doesn't want to...", so that's why the final verse is like that, I guess
Oh, and the original is from '88, but that might be less to your taste:
 
11:45 PM
@beaker I've added +=1 and -=1 to MATL. It was an old suggestion of yours (more or less)
 
@rayryeng hey ray! :) I was just wondering if you're free any time to possibly teach me how the kernels in SVM's work?
I actually attended a hackathon in UCLA called IDEAHacks (it was mostly hardware though)
But I managed to detect emotion from faces from a sample of 5 different people ranging from happiness to sadness to anger
Using opencv then putting it through an SVM which ran really fast for classifying, and it had an mean of 80% accuracy from a 5 fold cross validation test which was pretty impressive haha
 
I'll try and figure something out. I'm currently very busy this quarter.
 
So it made me really curious - why are SVM's so freaking fast?
 
It's the way they are trained.
They use a technique called Sequential Minimal Optimization
 
Ahh, no problem! I don't want to inconvenience you ^_^
 
11:52 PM
no problem.
 
I see.. I'll read up on it a bit before consulting you to save some time :)
How's the preparation for teaching so far?
 
I've already started teaching
but it's going pretty good
 
Ooh I see! What's your class average on your tests? ;) LOL
 
I'll let you know when they have thei rtest.
It's only been the first week. :)
My YouTube channel for the course is here: youtube.com/playlist?list=PLiF-6iXXcQqf4J4OJjU7zH1JrNCr29jas
 
ahh gotcha :) sounds exciting
 
11:54 PM
I'm borrowing heavily from Andrew Ng as well as introducing some of my own experiences.
 
Oh sweet - thanks for the link!
 
no problem
I'll get back to you on a time we can meet up. It unfortunately won't be today.
how are things going with you?
 
yeah that's fine! Does canada not have mlk long weekend?
Haha, things are going great - and
not going to lie, I heavily attribute my hard workingness to meeting you :)
 
nope. That's an American holiday
 
People are surprised that I know enough about ML to implement things and I tell them it's because of a guy in a stack overflow chat room LOL
 
11:56 PM
Martin Luther King is of course American so none of that here thumbs down
 
I gotcha, that's why I had time to go to a hackathon this weekend
 
hahah yup. You did well my young Padawan.
 
haha thanks man :)
 
Lui
@OneRaynyDay lol
 
Also, got internship at Symantec, I'm hoping to use some ML to find heuristic patterns in virus behavior
(I lowkey dislike Norton though)
 
11:58 PM
Norton I never liked either.
You can get a head start with Andrew Ng's CS229 notes though with Kernels
Start on Page 13
 
Ahh - gotcha, will go through it :)
Thanks! Currently doing some stupid C++ project for lowerdiv classes right now
 
SMO is also part of the notes. Section 9.
 
ahh i see it :o
 

« first day (200 days earlier)      last day (3032 days later) »