« first day (79 days earlier)      last day (3373 days later) » 

00:08
hey - can anyone please help me with a conceptual question?
00:24
@OneRaynyDay Haha... Stack Overflow... Built by Unicorns
 
2 hours later…
02:05
@OneRaynyDay - What's up?
Oh hey :) Caught me right when I came back from dinner actually haha
So it's about gradient descent(again), and it's about the part where you multiply matrix theta with X
@OneRaynyDay - A'B != BA in general. I'm assuming you mean matrix multiplication
X*theta ?
Oh... yeah that's my question actually xD
Yeah, because I wrote this in my program:
X*theta computes theta^T * X for each row of your data matrix X.
temp = theta;
for i = 1:length(theta)
    theta(i) = temp(i) - alpha*(sum((X*temp - y).*X(:,i)))./m;
end
02:07
yup that computes gradient descent.
Get rid of the ' and use CTRL+K to indent the code
Gotcha :)
But see in mine I didn't transpose the matrix
Yes that's fine.
I just did X*temp. In the modules andrew ng said to do temp^T * X
Yup that's fine.
The reason why is because in this case, you are computing the dot product.
So in this case temp'X = Xtemp?
02:08
If X and temp are vectors of the same length: X^T * temp = temp^T * X.
That's the dot product.
Remember linear algebra?
Uhmmm yeah sort of!
Here's a better picture
I think X is a matrix though
Yup that's fine.
This is the case for two vectors.
ahh.. mind = blown
02:10
Now in this case, you want to compute this for a matrix. Each row is a vector.
I'm not sure when it would apply and when it wouldn't, but I'm looking into the dot product thing right now :)
So you want to compute theta^T * X for each row of this matrix
OK, hold on. Let me LaTeX up something
Oh yeah sure :) Hmm
So X is your data matrix... and theta is a vector of parameters
in our case, we're just looking at 2 parameters... theta0 and theta1.
In general, this can go up to n+1 parameters, including the bias parameter theta0.
So the goal... is to compute theta^T * X for each row, yes?
we want to compute the hypothesis for each sample.
so you would agree that the hypothesis h(x) = theta^T * x yes?
that's just for ONE sample
so we want to do this in MATLAB vectorized. Instead of looping over and calculating this for each sample, this can very easily be done with a matrix multiplication.
Behold
You would agree that the dot product: x dot y is equal to y dot x right?
because multiplication is commutative.
it's a sum of products of terms. It doesn't matter what order you multiply each value.
in a similar fashion, theta^T * x = x^T * theta.
Multiply X*theta and you'll see that each row of the result is the hypothesis for each sample.
In a similar fashion, you can also do theta^T * X
however, what you will get is a row vector, not a column vector.
you'd want the column vector because it naturally fits with the way your data is shaped.
oh woah, sorry ray! I was away because I'm packing up for UCLA. Give me one second to read all of this haha
@rayryeng I'm really sorry, my mom called me.
02:22
no worries. doing an assignment
@rayryeng ah yes, regarding this part, does it automatically do it for each row if you transpose?
which part
?
oh if you hover over my text the part where i replied to will be visible :)
I still don't get it lol
ohh, nevermind! I read all of it and it made sense :)
02:26
ok :)
yeah, for linear regression, gradient descent is very easy in matrix form.
it only requires one line of code at each iteration
I'm just a bit confused at the part where you said theta^T * x = x^T * theta. though.
ah well that just requires a bit of imagination. Give me 3 minutes to LaTeX it up
Because I thought matrix multiplication doesn't work always if you do A'B = B'A
ooh okay! thanks :)
That you agree with, right?
so what about
?
For scalars, A x B is surely B x A
Ahh.. Yeah I agree
02:35
So that's why for vectors, theta^T * x = x^T * theta.
For matrices, this is not necessarily true.
But not for matrices?
Ahh okay. But if it has the same dimensions it's true?
no not necessarily.
You can easily find counter examples
say we have 2 trials, so X is 2xn, when theta is nx1
Here, let me show you one
ohh okay
02:36
>> A = randi(3,3,3);
>> A

A =

     3     3     1
     3     2     2
     1     1     3

>> B = randi(3,3,3);
>> B

B =

     3     3     1
     1     2     2
     3     3     3

>> A'*B

ans =

    15    18    12
    14    16    10
    14    16    14

>> A*B'

ans =

    19    11    21
    17    11    21
     9     9    15
Also
>> A'*B

ans =

    15    18    12
    14    16    10
    14    16    14

>> A*B'

ans =

    19    11    21
    17    11    21
     9     9    15

>> B'*A

ans =

    15    14    14
    18    16    16
    12    10    14

>> B*A'

ans =

    19    17     9
    11    11     9
    21    21    15
None of the permutations are equal.
mind = blown...
But then...
BTW, when it comes to proof, as soon as you find one example that disproves it... a.k.a... a counter example, that's the end of that theory
right yeah proof by contradiction right?
However.. when it's a matrix and a vector... that's different.
omf flips table seems like I have so much to learn about linear algebra haha
02:39
If we had a matrix A and a vector x, doing b = Ax is also equal to b^T = x^TA^T
it just takes practice :)
Remember, I have about 10 years on you lol
actually more like 12.
Actually, here.
Not to be condescending at all, but take a look at this
ah by the way I'm reading it haha, I just forgot to let you know XD
And no problem! It's a great start tutorial - thanks Ray :)
I understand the mechanics of matrix multiplication, it's just it's a little awkward to visualize right now x_x I'll finish reading this pdf first though :)
sure :)
yeah matrix multiplication is a bit weird.
I'm used to it because I use it almost every day
02:54
Ahh, okay, finished the read(I didn't do the exercises though), must go to the gym now! Thanks Ray :)
Yeah, I'm guessing it'll become second-nature soon enough haha, I gotta do some exercises though
and not talking about the ones in the gym ayyy xD
k ttyl!
hahaha later.
 
2 hours later…
05:23
Did you guys see the release log for MATLAB 2015b? ( mathworks.com/products/new_products/latest_features.html ) - "New execution engine that runs MATLAB® code faster"
 
2 hours later…
07:18
@Dev-iL that's been the talk for the past day here ;)
 
1 hour later…
08:20
@Adriaan I probably should've searched before saying that :)
08:37
Wrote a tiny bit of comments on the process of logistic regression: Hope this helps someone :)
% cost function: 1/m * sum(cost(theta))

% cost(theta) = -[(1-y)*(log(1-sigmoid(theta))) + (y)*(log(sigmoid(theta)))]

% gradient descent = 1/m * sum(cost'(theta))

% ==== I didn't include the chain_rule_postfix which is just theta^T*Xi
% deriv which is just Xi ====

% cost'(theta) = (1-y)*(1/(1-sigmoid(theta))*(-sigmoid'(theta)) +
% (y)*(1/(sigmoid(theta)))*(sigmoid'(theta))

% cost'(theta) = -(1-y)*(sigmoid(theta)*(1-sigmoid(theta))/(1-sigmoid(theta)))+
% (y)*(sigmoid(theta)*(1-sigmoid(theta))/(sigmoid(theta)))
@rayryeng of course matricial multiplication isnt commutative
it sure helped me when I was trying to learn it though :) The partial derivatives were yummy
09:03
@OneRaynyDay im working on a partial derivation and itsnt yumy cuz it is taking me two days until now
@Agawa001 oh my gosh are you serious
@Agawa001 oh and regarding this statement, that was my bad actually - ray knows all about linear algebra - I'm still a newbie at it haha
09:23
@OneRaynyDay you should learn some matrix rules before pushing yourself to code in matlab, matlab cant assist you step by step how to calculate, it just processes
@Agawa001 right, but I'm taking a machine learning course in coursera
it says that you don't need any linear algebra prereq, though it'd be helpful
@LuisMendo The more you know! You are rigth! (they still sound the same to me) hehehe
Thanks for the rule sheet though! that looks super useful - bookmarked :)
I can write all of the algorithms in iterations, but matrices just trick out my brain a bit since im not used to it
anyways you r welcom, i should leave you now for keeping up my derivative calvary, good luck
@OneRaynyDay In coursera, whenever it says linear algebra not required, but helpful it means: "you better know it"
09:36
valid point! and have a good day @Agawa001 :)
But I've been just learning LA on the fly, and seem to be understanding things(albeit slowly)
If you are willing to learn it on the fly thats good
it takes a bit of extra effort
but tis fun
linear algebra is fun!
right! Super fun but super unintuitive for me haha
Magic of vectorization is enough to make me want to learn LA properly after this coursera course haha
@OneRaynyDay LA is, either super unintuitive or extremely obvious. Once you reaaaaally understand it (this takes time, it took me years), then its ridiculusly obvious why this matrix or that matrix behaves that or this way
Ahh, I see :) I hope to get to that level one day!
You will ;)
09:43
haha being optimistic ^_^ but anyways, I have to move into university tomorrow!
Taking a plane at 10:30 am, it is 2:43 am right now, so I should get some sleep haha
First day as a freshman is going to exciting :)
aaaah I wish I could be a freshman again!
enjoy it!
haha yeah I will! Thank you!
and goodnight man :)
good morning here ;)
10:09
hey
has anyone programmed in android
?
Thats a very very very general question
actually i want to know
whats an encoding
utf 8
windows 1232
UTF-8 is a character encoding capable of encoding all possible characters, or code points, in Unicode. The encoding is variable-length and uses 8-bit code units. It was designed for backward compatibility with ASCII, and to avoid the complications of endianness and byte order marks in the alternative UTF-16 and UTF-32 encodings. The name is derived from: Universal Coded Character Set + Transformation Format—8-bit. UTF-8 is the dominant character encoding for the World Wide Web, accounting for 84.6% of all Web pages in August 2015 (with the most popular East Asian encoding, GB 2312, at 1.3%). The...
It has nothing to do with android
Google stuff ;) thats what is Google for
ok
thanks i just want to know if i change the encoding then will it be a prob
That is a very general question also XD. If you change the encoding of what? where?
Still, probably the matlab chatroom its not the best place to ask about java/android ;)
10:13
ok
no prob
@AnderBiguri have u work with neural nets?
just genral not some expert kind of wrk
No i dont work with them. But I know a bit
ok
i actually want to use the neural net app in matlab to use a fitting algo
using expectation maximization or some other model fitting algorithm.
fitting a multivariate Gaussian in the persons image
so I want to tak ethe whole image as the input
A whole image?
Thats generally not that a good idea. The most complex NNs nowadays take a 100x100 image as input
10:19
so shud i compress it
using pca
?
Generally you want to extract "features" from your images
hmmmm
Diffirente applications use different measures, and there is a huge sciecne to it
PCA is one of the most common features to use
so this can wrk right?
first compresss and rthen use
Yes it can, but there is no way to say if it will
you need to try
10:24
but hw to use that app and also which one will wrk nftool?
No idea. I know a bit of the theory of the NNs , but I dont know how to use the app.
ok
and one more thing
this is genrally done for one image or for a collection if amiges in a particualr dataset
if suppose i am using a binary dataset of human gait movemnts wrt time
? Sorry I didnt understand it.
can this model fitting algo be done for a collection of images
at one time
or gerally it is done for an single image
It has to. PCA only works if you compute the PCA of your collection of images
10:31
for a*
If you put 1 image more or 1 image less the result of PCA will change
u mean that there has to ba collection f images form my dataset whose pca images i have stored somewhere
and i have to use them
?
To train you NN you need a collection of images. the "training set"
The PCA to train them, you need to compute it for the whole training set
I am not sure if this is what you are asking. can you be a bit more verbose/clear?
there has to be an input vector that is feeded in to the app
so how to make such thing
or should i just load the mat file of training set
the input vector is your data. The features.
10:39
right
?
ok so basically what I can do is just compute the pca of invisdual images for eg sya 10 images from that dataset of 300 and then store then in a cell array in a amt file and then
feed that
Man, no ofense. you need some learning to do, get some tutorials
do not compute the PCA of the images individually.
You need some understanding of what you are doing or else you will have problems in every step of the project
i will so that neural net part form andrew ng course and then ask u again after learning what the hell is a neural net !!!
will that be fine?
do*
@ninja Yeah. The NN part of Andre Ng has a exercise of eigenfaces that uses a NN and PCA
ok
Do that! It will help you
Sorry I can not help you more in a chat, but its just complicated. I teach PCA in university, and I spend hours triying students to get it. Its just not possible in a chat
10:42
ok i will do it as fast as I could complete till week 5 at least .i am currently on week 3 so the neural net part has nt yet come
It will soon ;)
can i send u a mail just my results from my code or even my codes ...
Not now, sorry. Im just too busy with my stuff ;)
Maybe I will be able to help you alter on, but not this weeks
ofcourse yes ,not now but later after I complete the neural net thing from NG
you might not need any help after that ;)
10:45
little doubts not full mentoring
ofcourse ;)
r u a TA?
u said u teach @AnderBiguri
I do some TA yes
Computer Graphics, Control theory in Arduino and Python for begginers
teaching is a difficult job
It has its tricks indeed. It is very important one understands everything perfectly before teaching. Also one needs to be able to change the way one explains the stuff, as different people understand things differently
I believe SO is quite good training to be a teacher
hmm
 
1 hour later…
12:16
@Dev-iL how is your desperation going?
I didn't realize how many 'obscure' GPS coordinate formats there were
Neither I did
I should make an excaza coordinate system, centered on me at all times
Googleing that was werid
hahahhaaha
12:33
@AnderBiguri - Well, yesterday I managed to get the cuda version of my desired filter working, but the problem with it is that I need 16bit support, and all I have is 8bit, and I have no idea what to do to make it work with 16bit as well
does cuda support that ? Iguess it dies
but have you checked?
why not?
I dont know, hardware sutff
no idea. I know that Teslas are better for computing than Gforces because they have support for double precission floats
Gforces can do them also, but it takes them way longer
The guy who partially fulfilled the feature request for 16-bit support (on the CPU) said it required major refactoring
Did it? so its not only "change data type" problem then?
12:37
So I'm currently down to several options:
1) use the cpu version and keep the precision, but pay with computation time
2) use the cuda version and lose precision, but gain performance
3) get help \ hire somebody to adapt the 16bit filter to work with cuda
@AnderBiguri - That makes sense, right?
It does indeed
have you looked around if you can find the code?
It's opensource, but I don't know how/what to modify for it to work... It can be something as simple as uploading a Mat to the gpu, and it can be something crazy like major refactoring
Yeah it says its 16bit support. This is the code you got the same input as output?
That problem is resolved, and it happened for an 8-bit input
line 147 says its ok to use 16 bit
12:40
It's part of opencv now btw
yeah but this is CPU code, like I said
aaah
I dont know, as far as I know it shoudl be good in CUDA, but no idea in openCV/CUDA. CUDA accepts char, short, int data types without any problem
they are 8,16,32bits respectively
What is the CUDA fuction you use with 8bits? can you show me where that is in the opencv code?
It might be easy to modify
12:56
This must be my finest use of end ever
0
A: Person of Interest

Luis MendoMatlab / Octave, 172 bytes x=sprintf('Crime predicted: %011i\nCalling: %014i\n\n',[randi(1e11,1,30);randi(1e14,1,30)]);x(bsxfun(@plus,0:54:end-1,[21;24;40;44;48]))=45;x(39:54:end)=49;disp(x(1:end-1)) Try it online

x(bsxfun(@plus,0:54:end-1,[21;24;40;44;48]))=45
:-D
grmph, I feel like Edric is stealing my answers :(
again an answer of him which adds almost no additional information to my answer and tells a lot less information in total
@LuisMendo - what is this, I don't even
@AnderBiguri - \opencv3\modules\photo\src\denoising.cpp and denoising.cuda.cpp
The function I care about is this:
void cv::cuda::fastNlMeansDenoising(InputArray _src, OutputArray _dst, float h, int search_window, int block_window, Stream& stream)
this one can be as beneficial:
void cv::cuda::nonLocalMeans(InputArray _src, OutputArray _dst, float h, int search_window, int block_window, int borderMode, Stream& stream)
ok i don't have opecv so Im triying to find it onlint
sec will give you a link
You can find both files in there. The denoising.cpp file contains the 16bit modification (CPU), and the denoising.cuda.cpp contains the functions I want to be able to run with 16bit support
And it does not work with 16bit?
13:03
nah
@Dev-iL You can use end in any expression, if outside that there's a variable to which end refers
16
Q: What are the semantics of 'end' in Matlab?

Chris TaylorIt's common to use the end keyword as a shortcut for accessing or extending an array in Matlab, as in >> x = [1,2,3]; >> x(1:end-1) ans = 1 2 >> x(end+1) = 4 x = 1 2 3 4 However, I was surprised to find that the following also works >> x(1:min(5, end)) ans = 1 2 3 4 ...

@LuisMendo - I even remember writing a piece of code where you can use python's style negative indexing in MATLAB
@Dev-iL GpuMat extended_src = pool.getBuffer(esize, src.type()); Seems to suggest that it does. damn I can no ttry it because I dont ahve admin rigths
Man opencv3 systanx is crazy
@AnderBiguri I'm willing to give you remote access to my computer if you're willing to take a look at this :D :D
What happens when you run 16bits images?
13:07
` CV_Assert(src.depth() == CV_8U && src.channels() < 4);`
nothing good lol
And... modifiying that? :P
because fastNlMeansDenoisingColored does stuff with *bits, but cant see any 8bit thing in the fastNlMeansDenoising
dunno too scared to try, might open a small black hole or something
let's see
@Dev-iL to be honest I am very busy with my stuff and should be working on it :S Its just I am stuck in a deep hole and have no idea how to get out XD
@Dev-iL try it... hehe
well what are you {supposed to be} working on?
Just finishing my CUDA code. Its almost done
but now my two complex peices of jigsaw should join together
and they refuse
Cone beam computed tomography projection and backprojection to be specific
13:19
Apparently I am unable to recompile opencv with the modification
13:31
Weird
Due to my lack of skill in dealing with cmake and VS.. I downloaded the precompiled binaries after wasting over a day trying to compile it on my own :x
I think @ray knows a bit of how to do all that stuff
14:09
posted on September 18, 2015 by Steve Eddins

Image credit: NASA/JHUAPL/SwRI... read more >>

You are going to need to work harder :P
14:26
@AnderBiguri can u plps tell me the best book to learn ANN.I want to go deper than that course
@ninja I dont know. My knowledge is not much wider than what Andrew Ng taught on that course.
that one is very good, on machine learning. But its a bit advanced. I think to much for oyu
I'm thinking of starting up "apocalypse insurance" I wonder how illegal it is
14:50
@AnderBiguri - hahaha that was during when I was sleeping. Nice catch.
Yeah. I need to make it harder for you to get that badge! :P
hahahaha.
that's fine my friend :)
MATLAB's classes totally baffle me sometimes. If I have scatter(1, 1, 150, 'k', 'o'); [~, icons, ~, ~] = legend('Circle'); and I try to get the Type of each member of icons, icons(1).Type functions fine, icons(2).Type functions fine, yet icons(:).Type throws an No appropriate method, property, or field 'Type' for class 'matlab.graphics.primitive.world.Group'. error
idgi
Yeah because that gives you a comma-separated list.
Maybe convert this to a cell array of handles instead?
what gives a comma separated list?
15:02
Usually when you try and reference one field in an array of structures.
wait a minute...
what you did SHOULD give you a comma-separated list
because icons(:).Type is the same as icons.Type.
You'd think that
:p
For example, if you did: s(1).f1 = 1; s(2).f1 = 2; s(3).f1 = 3;... doing s.f1 or s(:).f1 in the command prompt is the same as s(1).f1,s(2).f1,s(3).f1
one proceeds the other in the command prompt, and you'll see three separate outputs to ans.
Try looking at struct2cell.
Yes, which you can collect into an array
but it doesn't work for Group objects
:S?
Old fashioned loop then lol
gross
15:05
hahahah :D
I think that's bug report worth
Yes I'd say so
@excaza you are rigth it might not be a duplicate.
If you try it on the marker it has some pretty interesting effects
turns the circle into a pointy star thing
15:10
coool :)
@excaza - Type is an actual field right?
Hey guys. Do you know if its possiblt to reverse the Y axis of imagesc?
So when I put a pointer in the image, I get the X,Y coords of that point, where XY=(0,0) is the bottom left
@rayryeng Type isn't a property of Group objects, but it is for pretty much everything else
(I am doing some deep debugging and the fact that the image is fliped its making me crazy)
nvm I found it. I was doing set(gca,'YDir','reverse') and wasnt working
turns out imagesc already has that, I needed set(gca,'YDir','normal')
@AnderBiguri - Shortcut is to do axis ij to invert and axis xy to revert back.
@rayryeng yeah, but I didnt know imagesc already has axix ij
so wasnt working
15:18
oh :D yup. it does.
Ineeded axis xy
hmm
apparently it won't work for mixed structures of any graphics objects
maybe it's more of an enhancement request than a bug report
@AnderBiguri - Check your email
I got an e-mail from StackExchange about our swag.
:D :D :D :D :D :D :D :D :D :D
@LuisMendo @Divakar @chappjc @Amro - Check your emails. They've sent out requests for information to get our swag.
the comments to fill out the form are HILARIOUS
they make it really unambiguous so people don't mess it up lol
"Country: Go up really high and draw the shape that you see, then see if you can find something that looks like it on a globe."
15:34
I have no idea if i should get M or S
I usually go one size up.
Because clothing shrinks over time, depending on how you treat it
@rayryeng LOL
:D
The form is idiot proof.... until an idiot breaks it
Make sure you give them the link to your META SO profile.
says so in the help text.
yeah
done!!!
swag!!!
gotago
see you fellas
bye!
15:50
@rayryeng Great! I haven't received it yet, though
ok let me know if you don't by the end of today. I'll give you the link to the form you need to fill out

« first day (79 days earlier)      last day (3373 days later) »