« first day (1540 days earlier)      last day (1671 days later) » 

7:56 AM
:)
 
 
1 hour later…
8:59 AM
OP deleted question after receiving a valid answer stackoverflow.com/q/57988553/5211833
 
9:09 AM
Already done
 
Interesting; I left the OP a comment pointing out they should accept/upvote the answer and that it's rude to delete a question after receiving a valid answer, but that already got deleted.
Then the OP won't be educated I guess.
 
 
3 hours later…
12:11 PM
@Adriaan Telling people to vote on stuff is always sketchy. Stick to accepts.
 
Please accept the answer/vote Trump 2020
@Dev-iL "Program files larger than 128 MB or with high complexity produce error"
the what
 
12:49 PM
So, if I have a 3D matrix and I want the mean of every 4 columns together (of the first dim), I need to create a 4D matrix, right? My head is not reshape-friendly today
 
@AndrasDeak So I should only tell them off for deleting a question with a valid answer, and not tell them what to do instead?
@AnderBiguri moving average, or just 1-4, 5-8, 9-12 etc?
 
yup
second
 
Then stacking a n-m-l matrix to n-m/4-l-4 sounds like the way to go
 
but to do that I need some permutes and stuff
agh
I might just write a loop XD
 
@Adriaan tell them off, and suggest accepting if it solves their problem
(and upvote the answer yourself to hinder their next delete)
 
12:56 PM
@AnderBiguri would be my preference :P I don't even know where to begin to collect 4 2D matrices (all rows/pages of a single column), then stack those along the 4th dimension. Sounds difficult :P Every fourth column, i.e. 1:4:end; 2:4:end etc would be easier to index
 
yeah, just loopyloop
 
I like loops. Until people come along on the same question and blow my answer out of the water with fancy stuff (yes, I'm looking at you @HansHirse)
 
1:39 PM
@LuisMendo Did you by chance copy-paste the wrong link here? This dupe doesn't look related at all to me. stackoverflow.com/questions/57983285/…
 
@CrisLuengo if you know which one is the real dupe, you can edit the dupe links
 
Luis' choice seems weird indeed. Bla's choice makes sense from a mathematical point of view, but just like we have our own "is floating point math broken" target, I prefer a MATLAB solution
 
Likely Luis just made a mistake with that link
 
Bla duped to a question asking about the normal logarithm (plus in a different language). It wasn't immediately clear to me that the normal logarithm property also holds for matrix logarithm, which is why I did that experiment, and why I thought it was worth a separate answer.
OK, I found a dupe. I don't like that answer as much as I like mine, of course, but it does give the recipe.
Actually that dupe gives some limitations regarding the definition of matrix logarithm that I hadn't considered. It's a pretty good answer.
 
Sam
1:57 PM
yo
 
yo-yo
 
Sam
wazzzzap
@AndrasDeak I have another NumPy query and I think you're the man
 
shoot
 
@AndrasDeak Isn't that a euphemism for "shit"?
 
Sam
I'm implementing a custom layer in Keras which is basically an extention of global max pooling.. But, instead of taking the max value of a feature map, I need to split the feature map into segments and take the max value of each segment. So, assume I have a matrix (n, 18, 200) dimension. This corresponds to (batch_size, steps, maps). For each map, I need to split the steps axis into two chunks. c1[0:i]; c2[i:end]
 
2:11 PM
@CrisLuengo it is now
@Sam (probably won't work with numpy)
 
Sam
No?
 
You want (batch_size, step_0_a) + (batch_size, step_0_b) for map=0, (batch_size, step_1_a) + (batch_size, step_1_b) for map=1 etc, right?
numpy arrays usually don't play nice with raggedness
 
Sam
Yeah, but step_x_a will always be the same value regardless of the map
 
Ah, I see. That wasn't obvious.
 
Sam
Maybe this visual will help. Blue squares can be considered as the split point indices
 
2:16 PM
I don't think there's anything better than c1,c2 = arr[:,:i,:], arr[:,i:,:]
and the same goes for segmentwise maps
you might be able to use c1,c2 = np.array_split(arr, 2, axis=1) for an even-ish split
 
Sam
I seriously need to learn my slicing
 
>>> arr = np.random.rand(2,5,3)

>>> c1,c2 = np.array_split(arr, 2, axis=1)

>>> c1.shape, c2.shape
((2, 3, 3), (2, 2, 3))
 
Sam
Ah OK so param 2 I sub in for whatever index my split point is
 
no, this splits into 2 even-ish chunks
if you want a general spit into 2 use what I wrote first
 
Sam
Oh right OK, yeah i dont think i need an even split at any time.
 
2:28 PM
@CrisLuengo I did mean that as a dupe. I interpreted the OP wants matrix log, not element-wise log. But maybe I got it wrong. Feel free to change link or un-dupe
 
yes, but you linked to "why is matrix multiplication so fast in MATLAB" I think
 
Sam
@AndrasDeak So i've got to this
c1, c2 = tensor[:,:trig_idx,:], tensor[:,trig_idx:,:]
c1_map = np.amax(c1, axis=1); c2_map = np.amax(c2, axis=1)
Which will give me two matrices c1_map (10, 200) dimension in my example
 
Yup. But I'd use c1.max(1) with or without a keyword
or is that argmax?
 
Sam
I now want to merge them into a single matrix (10, 400) but such that it satisfies the vector on the image I showed
 
>>> arr = np.random.rand(2,3,4)

>>> np.array_equal(np.amax(arr, 1), arr.max(1))
True
 
2:33 PM
@LuisMendo I already changed it. You had linked a question about why MATLAB is fast with matrix multiplications.
 
Sam
[max(c1_1), max(c2_1), ....]. If i just concat them together I'd get [max(c1_1, max(c2_2)...,max(c2_1), max(c2_2)]
 
@Sam I don't understand the vector on your image
oh, you just need to riffle them
np.array([c1, c2]).transpose(1,0,2).reshape(c1.shape[0], -1) or the same with .transpose(1,2,0) should do it
one will be the same as concat and the other the riffled version
I have to leave from work so I'l let you figure out which is which :P
 
Sam
thanks dude, really appreciate it
i need to upscale in NumPy
 
no worries
 
3:31 PM
@CrisLuengo Ah, thanks. The one I meant is precisely the one you have linked. I don't know what happened
 
 
1 hour later…
4:59 PM
@Sam did either work?
 
 
3 hours later…
8:15 PM
@sam how do you explain deep learning to a 12 year old
 
With you I never know if something is a trick question, a setup for a joke or an honest inquiry :P
 
hey this is dead serious!
I'll probably end up being the one having to do that.
 
Why do you have to do that?
 
As I'm currently quite low on the food chain
 
just detach a tail and run away
 
8:18 PM
cause some kids are gonna visit our stuff
 
Ah. That's cool. I guess you could emphasize google deep dream stuff perhaps?
 
@AndrasDeak no thanks
@AndrasDeak hmm that is nice to show off
 
kids probably like the trippiness
 
but I'd still like to give them at least somewhat of an idea or something to do
@AndrasDeak well I could also bring some shrooms if that was the point:)
 
also deepfakes, bet we'll see a lot more of those soon
neither help explain how deep learning works, but honestly with kids it's more about getting them interested in tech
 
8:22 PM
I thought about doing something a bit hands on, maybe a game-ish thing
maybe a "self driving car"?
(a virtual one)
I could make an AI that answers questions
 
Give them the old Clippy treatment. They are missing out.
 
but for practicalitys sake I'd just tell a coworker in the next room to type some answers cause I don't know shit about AI
 
@AndrasDeak hehe
 
8:40 PM
@sam and while we're at it: how do you explain deep learning to a 14 year old?
 

« first day (1540 days earlier)      last day (1671 days later) »