I wish I had this guy as my professor, I would never get bored in class again lol
@omg_look_behind_you7 жыл бұрын
Henry Goodman and you'd only need to go to the last 15min of class! love you, shiffman, but you know it to be true. i'd still attemt full on most days just to absorb some good juju.
@Truephoria6 жыл бұрын
All I can say, is that you're the perfect teacher. You make very complicated topics so easy to understand! Thank thank thank THANK you for existing and being the hero that the programming world needs! I tell everyone about your channel. To 1 million subs!
@nickbrougher23377 жыл бұрын
3rd year compsci major @ well-known school, learned more from a couple of your videos in a day than i have in the past two years of programming classes.
@voidemon490 Жыл бұрын
fr tho
@paladin11474 жыл бұрын
INCREDIBLE Video, my mind got blown to bits when you said you could just pass down functions within a function.
@hydra43707 жыл бұрын
For some reason I always watch these videos while programming, even if it doesn't have anything to do with what I'm making.
@pawemonster77686 жыл бұрын
I think that in Java is actually possible to create map function. You just have to use lambda expressions. In your example it could be like that: void map(Func map) { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { float val = data [ i ] [ j ]; data [ i ] [ j ] = map.apply(val); } } } Func is interface and is annotated by @FunctionalInterface (but it isn't neccesary). Func has one metod. float apply(float val); In code possible is: Matrix m = new Matrix(2, 3); m.map(x -> x * 2);
@matveyryabov45516 жыл бұрын
Thank you sooooo much. I spent 4 hours today researching and asking questions on stack overflow and finally noticed your comment. Works like a charm! Would you have any resource which you would recommend to learn about lambda expressions or could you perhaps explain to me further how your code works?
@pawemonster77686 жыл бұрын
I'm very happy that I helped you. To be honest I began with kzbin.info/www/bejne/naGshpmgaLCUhcU , and after that, I started to study more about lambdas and streams on my own. Just by reading jdk8 overview
@samuelgunter6 жыл бұрын
Can you send me the whole Func interface /* class *\ ? Thanks
@matveyryabov45516 жыл бұрын
@@samuelgunter sure i can tomorrow. How shall I?
@samuelgunter6 жыл бұрын
still waiting...
@elainegallardo74786 жыл бұрын
I have never understood matrix math before, not the way I do now. THANK YOU SO MUCH
@M1ckeyD4 жыл бұрын
Its wierd watching a tutorial series on Neural networks, and needing to go through static functions. Very thorough.
@ya647 жыл бұрын
Daniel, just wanna say that your videos are always inspiring, no matter the topic. Thank you!
@Pablo-pk2qi2 жыл бұрын
Duuuuude, I hope you will never stop making new coding videos :D
@realcygnus7 жыл бұрын
really great stuff Dan.....I can't wait for the next parts.......its priceless content imo.....& I appreciate it.
@TheCodingTrain7 жыл бұрын
Thank you, this series is a tough one!
@emteiks Жыл бұрын
Thanks for putting the course. Really helpful. I also noticed that chatGPT asked about simple neural-network example from JS provides code from your course! Food for thoughts! Positive fun to see your beard growing from video to video ;)
@QG19967 жыл бұрын
Where can I watch you live? I learnt a lot about deep learning from you.. I love that you don't cut out the errors you do.. This way I can learn and understand better from your errors!!
@tomhuibers3337 жыл бұрын
Already looking forward to the next one. Loving the nn videos!
@nathansoufflet7 жыл бұрын
Just had my Linear Algebra final exam this morning and only watching this now x)
@suprguy7 жыл бұрын
The naming convention for functions as arguments is actually callback. For example take a look at the documentation for Array.map() on your preferred website MDN.
@stefanvanreeth57197 жыл бұрын
The transpose function should also swap the values of this.cols and this.rows. Like it is now, if you ask the Matrix object for its dimensions when it was transposed, it gives the original values back. Depending on the format of the Matrix, this will either result in reading non-existing values in one direction, while omitting a whole set of data in the other; or the program breaks and sends an error to the console. Say, you have a 2 rows by 3 columns matrix. You use transpose() on it. You then ask the cols/rows properties to read the data array using a double loop. You will only read 2 rows (while there now are 3), and in each row the last column would yield an unidentified value, since you try to read 3 columns while there are only 2. This might be a hard to spot error since in this case the program doesn't break immediately. It probably will do that later on, when trying to do math on the unidentified values. In the case of a 3 rows by 2 columns matrix, the program would first omit to read the last column (because it thinks there are only 2), then break when trying to access the array in the non-existent third row. Off course, one can always read the lengths directly from the arrays in this.data, but that kinda defeats the purpose of the cols and rows properties. Maybe I'm a bit verbose here, but i felt an example was in order to clarify.
@JersenMan6 жыл бұрын
@ 15:00 It's fairly easy to do in java using functional interfaces. This way you can just do something like: Function function = d -> d*d; //this now accepts a double and squares it using lambda. matrix.map(function); Or directly: matrix.map(d -> d*d); in the mapping method you simply do: public void map(Function func){ for(blabla){ for(blabla2){ this.data[i][j] = func.apply(this.data[i][j]); } } }
@OLApplin7 жыл бұрын
I started doing exactly that this weekend because of my linear algebra class. I'm also trying to Gauss-Jordan those matrices
@andyc1785 жыл бұрын
16:37 *copies and pastes two characters*
@akaizn7 жыл бұрын
"Matrix world", Agent Smith: stay right there, don't move!
@carlosbeizaga2 жыл бұрын
This list is amazing! Thanks for it
@thefigmaster35195 жыл бұрын
Hey Dan, great video! How would i be able to apply the same idea of static methods to processing?
@0xTim7 жыл бұрын
Isn't your map function technically more like a forEach function?
@LeRouxBel7 жыл бұрын
14:50 => Well, in Java 8, you have access to Function, Predicate and so on, which makes functional programming pretty feasible. Sure has a few more steps than JS (imports, type declaration, ...) but it ain't too crazy once you get the gist.
@TheCodingTrain7 жыл бұрын
Thanks for this info!
@Dalendrion7 жыл бұрын
Yup. you can even use lambda notation now! m1.map(x -> x * 2); //doubles every cell It's awesome.
@mehdiSupp7 жыл бұрын
Rocking that beard !
@TheBeast-rz8te7 жыл бұрын
I really like your video style. You seem so human and flawed but still highly intelligent and just really relateable. Although I knew everything you said and wrote in your neural network videos, I still got something new out of it because you have your unique way of presenting and explaining. Thank you for that. Do you plan on doing some stuff with Recurrent Neural Networks? I would love that, cause I find them to be the most interesting type of network there is, I just hope that if you do plan on going over them, you do it without these fancy neural network libraries because it really diminishes the learning factor, imho. I would definitely not complain if you used faster matrix libraries. Again, thank you so much for doing what you do! :)
@TheCodingTrain7 жыл бұрын
Thanks for the nice feedback. Yes, I hope to get into RNN eventually, I will start using deeplearn.js at some point sooner than later, but I also like the idea of building simple examples without the library for explanatory purposes.
@TheBeast-rz8te7 жыл бұрын
The Coding Train That sounds really cool, I didn't want to discourage you, I just like it when you figure it out for yourself and simultaneously for us. Additionally, I prefer building these things for myself too, they might not be as fast or complex as finished libraries but building smth for yourself is a valuable lesson. Looking forward to the continuation of the series!
@MultiLeandrini6 жыл бұрын
Could you talk more about that "lambda function"?
@FlotteeMottee4 жыл бұрын
I would prefer the name "foreach" for your map-Function and maybe you could call the function you pass in a "callback"?
@RRKS_TF5 жыл бұрын
6:25 i was writing this in c# and I already did this part. cool
@bennis92837 жыл бұрын
17:15 this guy is amazing ^^
@francojohnc4 жыл бұрын
Other conventional name of func from map is callback
@ziedbenamor76586 жыл бұрын
Actually with java 8 we can now call a method with an Other as parameter using lambda expression, functionnal interface, référence method and Other stuff in prety easy way. Otherwize we can Also use design pattern strategy witch consists basically on wrapping methods with an object, put the object as a paramter and then call that method
@haydergfg67025 жыл бұрын
Good job
@akiilino6 жыл бұрын
One thing I noticed is that the sketch.js with the function doubleit(x) written does not work on Opera. With Firefox, it returns 2 tables with the same values. Then I decided to try with Opera browser, and returned correctly (2nd table values are double of the first). Anyone knows the reason?
@Zakiyfarhanfuad6 жыл бұрын
same here, i'm using edge.
@samuelgunter6 жыл бұрын
for whatever reason, firefox is dumb and just console.table's the end result of the variable. I just used chrome while I was making mine :3
@Voltra_7 жыл бұрын
You should extend from Array, that would be cleaner than using an inner array
@TheCodingTrain7 жыл бұрын
good point!
@omg_look_behind_you7 жыл бұрын
grandpa crockford would send you out for a switch and bend you over his knee. shiffman...he might just toss him in a bag full of puppies and toss in a river.
@lcpholman7 жыл бұрын
But a matrix is not an array. Can't see anything clean about that
@Voltra_7 жыл бұрын
Lindsay Holman a 2D array is basically an array of arrays. Of course there are drawbacks but in this case (just for fun) it can ease the job
@TakeiRyo7 жыл бұрын
3:43 oh I know. :%s/this.matrix/this.data/g Get it?
@Creuilcreuil7 жыл бұрын
17:10 it's called a functor
@AliSher-ol4wc4 жыл бұрын
Sir can we use MATLAB for implementing MLPN Neural Network
@AlexanderZotov7 жыл бұрын
Where is "Love" button?)
@karthikd4907 жыл бұрын
Video Request : Could you make a tutorial to plot Elliot Waves pattern recognition neural network on stock prices. Thanks in advance.
@tell52437 жыл бұрын
where would i find the updated code for this lesson?
@ultra_nerd3 жыл бұрын
would it be possible to do the map function in java?
@nolachronicle73866 жыл бұрын
Can anyone direct me to a place to figure out how to use the lambda expressions in order to use this map function correctly? programming this in Java. Thanks!
@count_of_pizza7 жыл бұрын
This is truly awesome :) speaking of matrix, I have idea for coding challenge: create simple 3D object in canvas which can be rorated using keyboard or buttons :)
@samuelgunter6 жыл бұрын
that isn't a challenge?
@rodolfoamaya45287 жыл бұрын
Daniel, I’ll be starting college this upcoming Tuesday (January 16) and I was wondering what computer should I buy? I’m going for my basics right now but overall I’m interested in getting a bachelors degree in computer science. I’ll be watching your videos in the mean time and doing any coding that you teach me. I’ve always wanted wanted a MacBook but price is an issue for me. Should I borrow some money and buy a MacBook? Or what do you think I should do? Thank you.
@LeRouxBel7 жыл бұрын
Hello Rodolfo. If I may, I just want to say that you don't necessarily need a powerful computer for college coding. I understand that you might want a cool machine, but borrowing money is not the best. Look for something you can afford first (maybe a second-hand MacBook if you can trust the vendor). If you need this computer for coding and classes, there's no wrong choice really, anything will do. What I'd do is ask your classmates and teachers on Tuesday., see what they think / use. There is no hurry and this is a big money investment. Have a great first day of college !
@rodolfoamaya45287 жыл бұрын
Art Work c thanks for replying! What do you recommend?
@c13377 жыл бұрын
You are the best
@lcpholman7 жыл бұрын
You can't easily pass functions in java? You can since lambdas were introduced in java 8, but that was only 3 and a bit years ago I guess.
@TheCodingTrain7 жыл бұрын
Ah, this is a very important correction, apologies for the mistake!
@lcpholman7 жыл бұрын
No apologies required :). I should correct my own mistake, as in addition to lambdas, we also had method references and functional types added, which all contribute to easing the pain.
@N0D0hNuts6 жыл бұрын
You mean that the code he wrote as map(func) would work in JAVA?
@lcpholman6 жыл бұрын
N0D0hNuts Conceptually yes. The syntax is different (-> in java as opposed to => in javascript), and in java you map a steam rather than the collection directly, and of course type checking changes the landscape somewhat),
@N0D0hNuts6 жыл бұрын
Lindsay Holman wow thanks for that quick reply! :) good to know. I'll look into it
@emilie19777 жыл бұрын
Superrr Daniel!
@NeverBeenToBrisbane7 жыл бұрын
I have a question that idk how to ask Google: is there a way to add the +,-,*,/ operators as part of the functionality of different objects? Like if I want to add two matrices, is there a way I could make it so I could do something like "m3 = m1 + m2" I know C allows it but I can't find anything similar in JavaScript
@alexanderristinmaa7 жыл бұрын
Devon Farrier I know it’s possible, but I don’t know how.
@alexanderristinmaa7 жыл бұрын
Devon Farrier stackoverflow.com/questions/19620667/javascript-operator-overloading you should check this out.
@NeverBeenToBrisbane7 жыл бұрын
MaTriX thanks at least we know it's possible then :D
@NeverBeenToBrisbane7 жыл бұрын
Drat there is no operator overloading in JavaScript .-.
@AntiHeadshot7 жыл бұрын
Arrow Functions! a.map( x => x*2 );
@NardiPaffon5 жыл бұрын
when he does the "replace this.matrix with this.data" I was like "noooooooooooooooo you forgot the others!!! Someone watching live please tell him!!! :( :( :( "
@Toopa887 жыл бұрын
Trying matrix stuff in C right now xD
@MatthewBishop645 жыл бұрын
I already made a print() function 3 videos ago haha
@andrewmasek21705 жыл бұрын
Same
@JimTVmusic7 жыл бұрын
Hey guys, try to use my mixes while coding and maybe Coding Train will share it ^_^
@badsyntax1736 жыл бұрын
Higher order functions
@badsyntax1736 жыл бұрын
I know I'm late but you really should Abstract out add and multiply with map. There is so much repeated code you are gonna have hell if you ever want to make changes
@badsyntax1736 жыл бұрын
add(n) { let f = function(x) { return x + n } map(f) }
@TheCodingTrain6 жыл бұрын
Thanks for this suggestion!
@badsyntax1736 жыл бұрын
The Coding Train My bad I checked the git, it was already fixed.
@andruw50755 жыл бұрын
Your static multiplication doesn't work...
@mlshkkz4137 жыл бұрын
come on man another matrix video? 😅
@witherking2537 Жыл бұрын
But there are lambda functions in java lol
@slmtv76997 жыл бұрын
7th
@dominicforster7067 жыл бұрын
Hi, your map() function could also be realised by using my favourite design pattern: The command pattern :)
@TheCodingTrain7 жыл бұрын
Say more!
@dominicforster7067 жыл бұрын
gameprogrammingpatterns.com/command.html using this pattern you could specify an command to map and then call execute() to all of the data
@suprguy7 жыл бұрын
Dominic Forster you wouldnt gain anything by using it though