« first day (694 days earlier)      last day (2750 days later) » 
06:00 - 14:0014:00 - 23:00

06:55
oh, the chat curtain is posting dupes again
it's not the feed this time right?
 
1 hour later…
08:14
T.T
-1
Q: Why MEX return error for normrnd when dimension is specified?

J daneI successfully compiled the MEX file, however when I try calling it in matlab it says matrix dimension must agree. I did specify the output size of normrnd. in=[3;3;0]; sigma=0.1; N=100; %Following function is compiled into MEX using MATLAB Coder function [output] = testmex(in, sigma, N) output...

This OP is driving me crazy
I deleted a lot of comments in the beggining that were "please post full code" more or less
and after 15, OP is still not showing the code that errors
I CVd that and quit
user6845426
hello o/
user6845426
08:30
Any GMM wizards
Not wizards around here unfortunataely :(
user6845426
HALF BLOODS?!
I know the very basics of GMM, so I doubt I can help, but you may as well ask
@dipper not even :( :( You think we would be coding?!?!
:P
user6845426
I've got a machine learning exam coming up so i've been looking at some mock questions in preparation. One of the questions show 2 clusters represented as single gaussian functions and an outlier which sits an even distance away from each cluster and the question asks which cluster should said outlier be classified into.
user6845426
My guess is because in GMM each point is given a probability of belonging to each cluster that it would be 50/50 in each cluster
08:34
I assume depend in the \sigma of each cluster right?
I do not know much, but if one cluster is wider, if they are at the same distance the wider gaussian eats the point
If you assume both gaussians have the same spread, then I'd say your answer is good
If the point is in the middle point between the maximum of those gaussians, it has no 50/50 probability
its more likely to be in the blue one
Do I make sense?
user6845426
Ah yeh I got you
user6845426
In that example. it belongs to 0
if the drawing is reliable
because you have 2D gaussians, so they have different "spread" in different direction
While the distance to the center is the same, the gaussians do not spread equally in the direction to the point
If you where to make a 1D plot following the blue-red line, you woudl get the same picture as the one I posted avobe
Yes?
user6845426
Ah so it would calculate given the closest spread of data?
more or less
The idea of using GMM instead of KNN for example
is that the points are not clustered by ONLY the distance to the centers
but those centers have a "spread"
gaussians can be very narrow (as the red one) or very wide (as the blue one)
To visualize that "better", take gaussian 0 and gaussian 1
and keep adding those circles around them
You will notice that you need to add WAY more circles to gaussian 1 to get to the point
and circles are contours of same probability values. The more "circles" you add, the lower their value
if you give me 10 mins I make code for it
user6845426
08:46
Is the spread defined as the standard deviation parameter?
user6845426
Awesome, thanks
Yes
Spread<> std
but note that a GMM has actually 3 std
STD_x STD_y, STD_xy==STD_yx
in the example you posted, both GMMs have the same std values in each direction, but the trick is that the point is in Y for 1 and in X for 0
08:59
Im on it, having problem with plotting
@dipper
Same thing
The red X is at the same distance from both
Howver, note where the point is very close to have P_0=0.0059
It is very far away from the top one. P_1 eould be a much smaller number
user6845426
That makes sense regarding the spread. Are the float values the weights?
user6845426
Thanks for helping btw :)
They are the probabilities
clear;clc;


mu = [4 0;0 4];

sigma = cat(3,[3 0 ;0 .5],[3 0;0 0.5]);
p = ones(1,2)/2;


obj = gmdistribution(mu,sigma,p);

[x,y]=meshgrid([-4:0.1:8],[-4:0.1:8]);

GMM=@(x,y)pdf(obj,[x(:) y(:)]);
Z=GMM(x,y);
Z=reshape(Z,size(x));
hold on
plot(0,0,'rx')
contour(x,y,Z,10,'ShowText','on')
% contour(x,y,Z,[0.004 0.004],'ShowText','on')


axis equal
No problem ;)
That last image shows where probability 0.004 is, for both centers of the GMM
As it is a gaussian, the further from the center, the lower the probability value
Thus, while from the gaussian that is in the right, it has probability 0.004, for tha gaussian on top it has to have lower probability
Thus, its not 50/50 between them, even if it is a the same distance
Let me know if you dont udnerstand something
user6845426
I think I've got it. So we basically consider the spread of data as opposed to just its distance from the centre of mass
user6845426
09:13
I like how you started with 'knowing the basics of GMM'... further ahead than me xD Maybe thats a reflection of my institution lol
user6845426
Just looking at your TIGRE toolbox
09:27
Not really, I am just a student that has 10 years of being a student/researcer behind me
You understand things earlier with time
@dipper This is the main difference between GMM and other clustering techniques
user6845426
I'm coming to the end of my student hood
So am I, after 3 years of BSc, 3 of MSc and almost 4 of Phd :P
user6845426
3 years MSc?
user6845426
Oh you're at Bath. Nice place
As a final remark: this is K-means, th emost basic clustering:mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/…
Its distance based
user6845426
09:30
K means is problematic for outliers right
@dipper My uni in Spain had strange rules for that
It is jsut too simple. K-means just goes "closer to the center-> then there
but that deosnt necesarily hold very often
@dipper Yeah I worked a bit on that :P
user6845426
I'm considering MSc, I don't think I could hack a phd. Will you stay with the uni in a research/teaching position?
No idea
I found my PhD "easier" to do than the Msc/Bsc
If you treat it like a job, it just happens. No "Sttuding, exams"
uff I can not handle that XD
user6845426
I guess phd is more focused as well making it more enjoyable
user6845426
supposing you choose something you enjoy :p
09:35
It has a lot of other types of personal estress, but yeah. Yes indeed
I like doing research exploring new thigngs
You are also in the UK right?
user6845426
Yeah, i'm just across the bridge from you
user6845426
In Wales... the mother land
haha
Cardiff?
I have been around whales a bit, I like Snowdonia
user6845426
I'm in Swansea
and there are cool Castles
user6845426
09:37
And lots of sheep
haha yes
user6845426
But I normally live in Newport which is even closer to the severn crossing
user6845426
I've been to Bath a few times. I like the town
Its good! a bit small for my likling, but still quite nice
Never been in any of the both you mentioned
user6845426
I had a few friends studying in Bath so I came down for a night out. All the bars are underground right?
09:39
haha
yes the ones for partying
user6845426
I didn't enjoy them
I do not like them either to be honest
user6845426
Full of muggles.
I much rather like the feel of Bristol for going out
hahahhaha
user6845426
I'm hoping to move out of Wales though. Theres not much in the way of tech jobs down here
user6845426
09:42
Although I managed to find a cool job in Cardiff which I have an interview for next week
Nice!
What kind of CS jobs are you interested in?
Its a quite wide field
user6845426
This interview is for a medical research company and the role is data analysis
user6845426
I guess it'll be using unsupervised learning to analyse characteristics etc
Nice!
It has a lot of potential
I went to a talk where they trained a massive AI to predict 5-year survivavility on cancer patients
user6845426
I quite enjoy the field. Although I've not got a lot of experience
09:46
and they compared it to doctor predictions
user6845426
Oh nice
The ML did terrible, 51%
which is basically random, like a coin toss
the doctors did 50.5%
LOL
user6845426
HA!
Conclusions: Its too hard
@dipper fortunately, no one has experience on big data/learning
is a very new field :P
user6845426
Yeh true. I'm doing a machine learning module, we've only really learned the basics of different supervised/unsupervised methods but I find it interesting
user6845426
09:51
Oh I also enjoy cryptography as well
cryptography is fun
but its so much maths!
And then all your hard works gets screwed up by NSA
user6845426
Theres been two bomb scares in 2 days in Swansea. Don't plan a visit any time soon.
Real ones?
There was one yesterday in Bath
user6845426
'Suspicious packages'
aparently some fellow fogot his empty bag in the bus statio
user6845426
09:57
Oh that was the same situation as us yesterday
Whoever did it was worried about his bag, meanwhile the city center of bath was closed an police all over the place XD
but it was not a honest bomb scare, if that person would have lost his bag 3 days ago no one would have noticed
user6845426
True
user6845426
My brother owns a construction company and a site he was working on, they dug up world war 2 bombs lol
hahaha
My gf lived in Cologne, Germany, and it happened 5 or 6 times during 2 years
user6845426
Apparently its not uncommon
10:01
Weird to think that they live in a city full of bombs xD
user6845426
Are you familiar with ROC Curves?
A bit only
Try me :P
user6845426
10:30
Sorry, was afk
user6845426
I've got a graph which represents the performance of a single classifier
user6845426
user6845426
Hello Andras o/
@dipper yup
user6845426
And a question:
A hypothetical company is developing a mobile phone based technology to detect skin cancer based on photos of skin lesions taken using mobile phones. Each image is classified as either cancerous (positive) or non-cancerous (negative). The developed tool is for the general public to use and thus any detected positives should be referred to a specialist. Two classifiers have been developed: A and B, and their performances are shown in the graph. Which classifier between A and B should the company adopt? Explain your answer.
user6845426
10:35
I'd say B right
Im going to go on professor mode: Why would you say B?
user6845426
If its used by the general public, although the false positive rate is higher, we are only concerned with the true positives, which in this case B is higher
I wouldnt say "we are only concerned with the true positives"
BEcause of that is the case the app software is very easy!
function predict()
return true
But yes, I'd say B also. Better to predict True in false cases than miss some real Trues
user6845426
Makes sense, thanks. When do you complete you phd? :)
user6845426
I quite like the phd gowns
10:46
in about 3~4 months <starts panicking and running around the office>
@AnderBiguri Oi! Sit down boy and type your text!
No running around on my watch!
I just fucked up the whole TIGRE and am triying to fix XD
Poor sod. Is it a LION now?
user6845426
lol
10:49
You have tatoos?
haha nope
That was what TIGRE is now
a derp cat, becaus eits very broken
:(
I wish I had a team to work on this XD
A PhD on CT software anyone?
user6845426
o/
user6845426
I've some experience in ray tracing
user6845426
+1 point
10:57
@AnderBiguri weeelllll,
Not you! You would go and commit treason, go with the ASTRA people
I'll spend my time on seismic imaging :P
@AnderBiguri I would try to smash geological hammres through my patient because htey're not lying still
@AndrasDeak yo
@Ander just roll back to last year's state and it's fine :P
10:59
@AndrasDeak haha I broke it yesterday, so its OK
however I broke it introducing a 30% spedup
I want both, the speedup and the fix
(Speaking in memes is so much better than typing)
@AnderBiguri if you put return 0; on line 2, it'll be damned fast :P
hahahaha
Nah, it works oftern, just not always
still, I hope you can get both :D
Its fast and correct often
11:04
int rand(void){return 4;} then
11:31
0
Q: Duplicates in chat feed ticker

Andras DeakThere's been a drop-down feed ticker in the MATLAB & Octave room on SO chat for a long time. Last night we noticed that each post started appearing twice in the feed: The raw RSS feed contains each post once. The URLs in the feed links are identical and contain no protocol header (so if it's d...

 
1 hour later…
12:56
I'm packed and ready to hitchhike to Berlin!
I'm curious what's going to happen, when tomorrow morning I attempt my solo hitchhike... I've only hitched solo in Iceland, where people are nice
Germany is quite good for that right?
It's a single, straight road, 5 hours driving
I've only hitched in Belgium and Iceland, to be fair
and to Aachen, but that's practically NL :P
@AndrasDeak yea, I already told my brother he might have to pick me up in Bratislava :P
on the bright side: I actually speak German :P
that's half your mother tongue, that doesn't count
13:02
Flags as offensive
I'm sad to hear that you're so broke you can't afford a train ticket :( :P
Germans have that car sharing thing that you can only use if you are german
That's actually the reason I'm hitchhiking :D Train was €170 for the return journey, hence I elected to hitchhike
I say that because its name is so freaking long that no one non-german will ever remember it
mitfargenlehehaint or shome shit
mitfahrgelegenheit you mean?
13:05
wait, I might have accidentally got it almost right
that is awesome. Good job Ander.
4
That's practically Dutch anyway :P
well, Im hitching tomorrow
You still need a towel
I need help with something :P My dyslexia is destroying me
In computing, row-major order and column-major order are methods for storing multidimensional arrays in linear storage such as random access memory. The difference between the orders lies in which elements of an array are contiguous in memory. In a row-major order, the consecutive elements of a row reside next to each other, whereas the same holds true for consecutive elements of a column in a column-major order. While the terms allude to the rows and columns of a two-dimensional array, i.e. a matrix, the orders can be generalized to arrays of any dimension by noting that the terms row-major and...
Row/column major
so much ms
13:12
If I have the index of something in column-> e.g. A(1,3), how can I get its index in row major, e.g. A[0][2]?
knowing the dims ofcourse
In Rotterdam, Towel Day 2017 will be celebrated for the third time. The event this year will be held in Cafe Pardoen, Spaansekade 62, Rotterdam. They will serve a free Pangalactic Gargleblaster to anyone bringing a towel (until they run out of course). Other activities will include a Vogon Poetry Contest, Dwarfish Battle Bread Battle, and more chances to win fabulous prizes.
:O Pangalactic Gargleblaster?!?
Man, go there!
I only know that as a longdrink filled with different kinds of spirits, totalling an impressive 50% alcohol :P
I still need to read the books first though...
@AnderBiguri I feel like we've been through this
I am sure we have
13:14
anyway, column major vs row major are a transpose
Yes, if you have the whole data
but if you only have specific indexes?
column-major 1-based A(1,3) refers to the same linear index of row-major 0-based A[2][0], I believe
No, the numbers are the ones that I posted
A(1,3)->A[0][2]
no?
Look at wikipedi
a
13:16
a matrix A in column-major: [a1, a3; a2, a4]
a matrix B in row-major: [b1, b2; b3, b4]
both have a1-a2-a3-a4 and b1-b2-b3-b4 consecutively in memory
My problem: my kernel in CUDA is desingned to obtain A(u,v), but I was transposing A before the calls
this takes, for big images, 99.9% of the time
the tranpose
So, without rewriting the whoel code, I want to get from u,v to the column-major version
Simply swap the coordinates
if I just switch them, so I do A(v,u), it works if A is square
OK. Different approach: MATLAB's A(k,l) refers to A((l-1)*m+k), C's B[k][l] refers to B(k*n+l)
where n and m are the appropriate sizes
as Adriaan just said, just transpose the indices and fix the off-by-one
doesnt work if they are not square, right?
13:20
squareness is irrelevant, because either way you're indexing up to n*m linear items
Yeah, but I am not using linear indexes in C
Because I am using special GPU memory, so I need to index A[u][v]
So squarenes is relevant
in C, B[k][l] is just *(*(B+k)+l) or something
Not if using 2DlayeredTexture memory
OK, then you need to figure out how a 2DLayeredTexture works with matlab, because clearly you know more than what you're asking about :P
no, it is just a memory type
13:21
I'll close you as no MCVE
Closing as unclear XY-problem :D
The only important thing is that I do not use linear indexes, I need to give A[u][v]
poor Ander
It is not an XY problem XD
it's not XY, it's unclear and ill-posed :P
right now what you're asking is floating in the clouds and we're waving hands
13:23
@AndrasDeak this may work though
you need to get specific, what indexing does and what it's mapped to in memory
the only hard truth when you're passing between languages is memory
@AndrasDeak Then it's not in this country; we don't do clouds today
@AnderBiguri did you try the transpose thing or are you rejecting it on principle? I'd assume that it works, and try a dummy problem, like taking the column sum of a matrix
@AndrasDeak indeed. My problem is that I have, lets say a black box, that computes indexes for C, they are u,v and they need to go separate, no linear indexing. But my memory is in MATLAB order
that's easy to check
13:24
@AndrasDeak it works transposing
you're being unclear again
it takes 17 seocnds to compute instead of 100ms, becuase transposing big data is fucking slow
But if you don't transpose the input, but rather flip every index inside the cuda function. I.e. transpose :|
what Adriaan and I have been telling you
what used to be A[u][v] is now A[v][u]
Transposing is nothing else than a shuffle of indices in memory according to column/row major
@AndrasDeak I see this .... I may be mixing with something else
13:26
yes.
That works, but only for square matrices XD
@AnderBiguri I suggest vodka. Gets the creative juices flowing
@AnderBiguri you need to flip the max dimensions and whatnot
Not "because I say it", just because I runit, and it does not work
I may have something else wrong
13:27
quite likely
did you account for the swap in dimensions?
ah, I think what Ander's saying is that if you have B = [1 2; 3 4; 5 6], B(3,2) makes sense, but simply doing B(2,3) ain't gonna happen
brb, schnitzel sandwich time
yes, It did not work. But the problem is not that it crashes, it just measures the wrong element
I insist, look at the wikipedia example , that is my case I believe
@Adriaan but what Ander is also saying is that he changed the input, so what used to be B = [1 2; 3 4; 5 6] is now Bt = [1 3 5; 2 4 6] on input
so original B(3,2) and new Bt(2,3) are the same item
ah yes, then I agree
dude, we can open wiki
I am 90% convince that this is my problem
it's not that we can't; it's that we don't see how this is relevant
you need to be clearer about what you think
Look at the last index, for Fortram
A(2,3)
13:31
in C, A(3-1,2-1) does not exist
both are talking about a matrix of shape (2,3)
so swaping them does not work
you're talking about a matrix that is (2,3) in one representation and (3,2) in another
I definetly see how I am being unclear
Sorry I just find it very hard
to be more precise, you will only get consistent behaviour with the natural indexing mechanisms if you pretend that the two matrices are the transposes of each other
13:32
(not being clear, just folllowing this up)
I'll try to write this out post-lunch, be back later
Yes, yes I know. However the sizes of the matrices are user for SHITLOADS of things and after the whoel day of testing I am quite convinced that if I make the change that hsows up there, it will work
thas OK, im being stubborn
I will fix at some point
12 mins ago, by Andras Deak
to be more precise, you will only get consistent behaviour with the natural indexing mechanisms if you pretend that the two matrices are the transposes of each other
let me know if this makes sense @Ander ^
Yes, yes
I need a coffe and time ti digest this
thanks man
13:49
so if you want to work with the same memory (which you do), you need to tell C that your matrix is transposed compared to the MATLAB representation, and you need to consistently swap the dimensions throughout the CUDA part
if first index used to be height, now the second index has to be height
whenever you had a sum over rows, now has to be a sum over columns
etc
what I'm claiming is that if you're looking at the same memory block, then asking MATLAB for "the (2,1) element of a (3,2)-sized matrix" and asking C for "the [0][1] element of a (2,3)-sized matrix" refers to the same element in memory
I'm done for now, let me know whenever you've had enough coffee and time ;)
06:00 - 14:0014:00 - 23:00

« first day (694 days earlier)      last day (2750 days later) »