What's good George Bulldogs back again with another video. So we just finished checking out smackdown the first half of the WWE draft and Yeah Kind of confused on some things not gonna lie to you definitely confused on certain draft decisions But first before we get into that, I want to talk about obviously the bloodline Situations, so I wanted to kind of get this out first before we get into the whole draft so the first Pick in the draft actually was Roman Reigns Solo so-called and Paul Heyman They were the first pick in the draft Not the Usos and I was very telling and then we cut to the back or would not will the Usos and Kevin Owens the same he's ain't cut a promo On the on the rampway area entrance area to the ring to the ring And then we cut to the back and Paul Heyman's giving them this rah-rah rousing speech Like, you know, they're gonna they're gonna win and you know be back on the island of relevancy or whatnot and You see that Paul is looking at solo He gave solo the wrist tape for his thumb and you see like, you know, like He's talking as if he's talking to the Usos, but he's really looking at solo like, you know what you got to do So they have their match later on in the show Fantastic match Obviously, it's not wasn't as good as a WrestleMania match, but it was a good television match For the titles and as expected. Sorry to my screens. You know, don't know why granted the super kicks were getting a lot Kind of, you know, kind of much kind of like what they did at their match At WrestleMania this year, but nevertheless the crowd was into it They were loving it in midway through the match There's a screen-in-screen where Paul Heyman gets a call from Roman tells solo to do what he has to do So solo comes out there then he gets attacked by Matt Riddle all the way into the back again or whatnot So Matt Riddle kind of runs interference To stop solo from whatever he was about to do because it looked like they were setting up that maybe solo was gonna turn on on the on the Usos potentially, I don't know but Either way that didn't happen and ultimately as we a lot of us expected obviously Sammy and Kevin Owens they retain that it only makes sense and you can see The look of disappointment on Jimmy and Jay's face like because they were talking a whole big game like tonight's tonight We're gonna make the Tribal Chief proud. We dedicate this match to him and they lost So that's really what I'm really intrigued on what's gonna happen Are they gonna go to Monday Night Raw? Would they still be on Smackdown? But now will they be outcasted by Roman? You know, it's gonna be very interesting to see what happens and how that plays out So I'm looking forward to seeing that story play out, but We're gonna talk about The draft Specifically the first and second pick number one it made sense solo Roman Paul going to Smackdown That made sense, you know saying there There's a storyline within that draft pick alone with the Usos not being a part of Roman solo and and Paul Hey, man going to Smackdown. So that makes sense. I get it. They're doing raw Smackdown back and forth But Cody going to raw Confused me and here's the reason why Because I'm thinking okay If we're supposed to continue the story if we're supposed to finish the story that is Roman Finally losing the Cody or or Cody in his sense and for his Perspective winning the championship his father wasn't able to win winning the WWE championship in the process Writing the wrongs at what happened at WrestleMania overcoming the odds overcoming adversity, whatever whatever if we're supposed to finish that story How do we get to the story being finished? If Cody's not on the same show That's just my my take on it because it is starting to look like I reported earlier that the rumors are Cody and Roman at WrestleMania 40 is starting to look like maybe they do they are gonna do that and separate them and Cody's gonna go on this journey. Hell he may even go for the World Heavyweight Championship and lose He may be in I'm sure Cody's gonna be involved in that damn tournament. I honestly think that's what they're gonna do I think it was that's the case. I Don't even know if he's gonna win against Bobby against Brock Lesnar I'm there's so many things that I'm concerned with because of how they could book this if you're going with this diversity route Cody losing Losing maybe the Brock maybe I'm sure he's gonna be in that that tournament for the World Heavyweight Championship and Him potentially losing that too because I can see them putting it on self or somebody else But most like I can definitely see them putting it on set so What maybe what he beats Brock Lesnar but loses in a tournament or he loses he loses to Brock Lesnar and then Wins in the tournament or loses in the tournament for the title and lose to Brock Lesnar I don't know. We don't know. We don't know how far of a diversity. They want to take down take Cody roads To so I don't know. I hope that's not even the case Honestly, I don't even want Cody to even win it because it's it's gonna come off like a consolation prize. It is So I can see him maybe being in a tournament and still losing and that part be part of his adversity thing So when I mentioned, oh, maybe he wins money in a bank I think that should be reserved for someone else like a LA night I would prefer that or someone fresh or someone newer, you know saying so I don't know what you do. This to me was very confusing because I don't If you're if the goal is to keep them away from each other for a while to have them go back at it again at some point It's people gonna care That's what it come down to I don't know I am truly confused on what's going on here me personally I just feel like we literally started on this journey of Cody's redemption will Cody's story and trying to overcome the odds And it got derailed at WrestleMania and then it's continuously getting derailed To the point where now we don't even know what Cody story is gonna be about now Right now he has to focus on beating Brock. All right after he gets done with Brock then what? What do you do? Now he goes for the world heavyweight championship the answers in that tournament I If he wins it's gonna look like a token championship They gave to him because he couldn't be Roman. Here's the consolation prize if he loses then what would we go? I don't know man. This is it's a weird decision.  Oh, yeah, you want to draft them at number two. I understand I Completely get that But at the same time from a story standpoint It would have made sense if he maybe was the I mean You know saying you could have did Bianca as the number two driver Whatever you could have did somebody else But I get why they did that cuz he's done he's technically if you want to think about he's like the he's the top baby face So he'll be like the number two guy under Roman in a sense if you wanted to do that. I don't know But at the same time, it's like, okay You still you could have found a way for him to be like the third pick and have him go to Smackdown Or whatever the case may be I don't know It's just it's very confusing and then What's gonna happen with Roman who's Roman gonna face on the Smackdown side of things I think someone had said that Bobby Lashley had tweeted Roman Reigns Let me actually go check this right now to see if that's true because I don't want to put something out there And that what and that's not true Because I know he's on Smackdown now Let's see. I'm checking right now to see did he tweet It's been a minute. Oh Yeah, he tweeted at Roman Reigns. It's been a minute That would be that would be an interesting matchup It's Bobby Lashley going to defeat Roman Reigns. No, but I think that would be a fun matchup game They actually haven't fought so I can see Maybe Vince said that up Vincent Triple H said that up But at the end of day, it's just gonna be another person for Roman to beat So it could be interesting for you. We'll see what they do with that.  Uh I don't know what they're doing with Cody. Cody's story May have come to an end. I don't know or it may be on pause until Fucking next year's WrestleMania. So let me know how y'all feel about Cody Rhodes not being on the brand Uh, I'm not being on the smackdown brand Some people are saying well, maybe he can get traded to smackdown And that's a possibility because the draft is going to continue on through the week through the weekend So maybe cody does end up on smackdown. We will have to wait to see we'll see how it all plays out But let me know if you guys are okay with cody being on raw and are you guys okay? If that's if it's a permanent thing For him to go for the world heavyweight championship and not finish the story that he started You know going for roman. I don't know. Let me know how y'all feel about all of this Also, let me know where y'all think the story is going to go next with the bloodline now that the usos lost Once again, what's going to happen? How they're going to start treating them Will they even be on raw or smackdown? What's going to happen with them? Where y'all think they're going to go? But I appreciate all the love and support you guys showing on channel road to a hundred and fifty k Appreciate y'all kicking me see y'all in the next one. Peace. Oh, I forgot to mention I am the undisputed youtube president of the world


So hello and thank you for joining us today for today's public good app house demo event So joining me today. We have cat Murphy toms the director of digital strategy at Giving Tuesday Giving Tuesday leverages social media and a broad network to ignite a movement and global call to action to give Cat studies the use of digital tools and social movements particularly their use and shifting power creating mass Mobilization and achieving global equity. Thank you all for taking the time to be with us today. Thank you to TechSoup for having me We are less than two weeks to go before Giving Tuesday happens to us all whether we're ready for it or not So I'm hoping to give you all a little bit of background about where we've been where we're going and what we've learned Throughout these ten years now of giving Tuesday and the reason that we know all of this stuff is because of the data As you all likely know by now giving Tuesday was created in 2012 I was a really simple idea Could we create a day after a bunch of days of consumerism? Could we create a day that was all about the opposite about flipping that on its head? And could we create a day that celebrated generosity? And a day that encouraged people to do good and it turns out that you could Over the nine years with ten years now that giving Tuesday has been happening. This is the tenth one I can't even believe it this idea has grown into a year-round global movement that inspires millions of people to Use the power that they have within themselves to give to collaborate to innovate And celebrate all types of generosity It's spanned the globe we started here in the United States and we are now have giving Tuesday leaders in over 80 nations There's giving Tuesday activity that we are able to track via social listening tools and all of the data that's provided by our data Providers, there's activity that happens on every single Territory nation country every corner of the earth literally including space were intergalactic now an astronaut tweeted last year It was the best thing that ever happened to us But there's 80 of these nations have a leader a handraiser who organizes giving Tuesday in their nation in 2012 everyday givers Average people in the United States gave a whopping 2.47 billion almost two and a half billion with the be dollars in 24 hours to social good Work every year were astounded by this number, but we pretty sure we know the reason for why that is People don't just give money on giving Tuesday. This is and we welcome that this is an opportunity to celebrate all types of giving and we believe that every single act of generosity is One that's going to move our society forward and is it's these little actions that come together that are really going to change the world So people volunteer on giving Tuesday They give their voice by posting on social media for different advocacy efforts They give goods they give in kind they give in every single way that you can imagine and we are so thrilled about that And we find that it's our mandate to measure that talk about that in a few minutes So one of the things that we've learned from this is that you really want to offer as many on ramps into your organization As you're able to people want agency to affect change in the way that they're able to in the way that they want to And so you want to offer not just on giving Tuesday in general You want to offer as many ways for folks to tap into your mission and get involved Our mandate as I said as giving Tuesday the organization who runs giving Tuesday the movement, which are two kind of separate things We find that our mandate is to measure the giving Tuesday effect the generosity effect the mass mobilization that happens on giving Tuesday so that we can learn how to leverage this To propel even more generosity later on and throughout the year. So we established the giving Tuesday data commons. This is the largest philanthropic data collaborative of all time. All of our panelists are members of the data collaborative. There are 70. I think we're up to 100 now data providers. These are donation platforms giving portals you name it The visas and master cards of the world. Everyone collaborates and comes together to share their data. We think that this sharing Is what's going to move our sector forward in times where we need to be really resilient and really, really innovative when we share our data and analyze Giving data and trends where we're going to be able to move ourselves forward. Some of the things that we've learned about giving Tuesday through our data collaborative and other work. 84% of people most people that participate in giving Tuesday say that it inspires them to be more giving throughout the year. 52% of participate people who participate in giving Tuesday by donating. They say that they do that because they feel like they're part of a bigger group. And that's not surprising to us at all. People find tremendous joy in giving and when something brings you that amount of joy. You want to do it again. Right. So my advice to each and every one of you, including our panelists here is to create solutions and and apps and opportunities and experiences because that's what you're doing. You're taking your supporters through an experience, create joy. The actual mission of giving Tuesday. The organization is to reimagine a world that's based on radical generosity. The notion that someone else's suffering should be as intolerable to to us as our own suffering. And we believe that if people flex their generosity muscles regularly to create a habit out of giving That they're going to be much more inclined to other pro social behaviors later on and throughout the year. Everything from civic engagement to voter registration to activism to local community organizing And that that kind of generosity is going to provide the key to a healthy civil society. So if it's one thing that I want to leave you with today, it's that the Giving Tuesday movement gives us an opportunity to build the world that we imagine to be possible.  It's innovative handraisers like our panelists who I'm so excited to hear about. And each and every one of you as nonprofit and social good organizations to do the work that you're doing to be innovative to be creative to create moments of joy. For your supporters who are going to make this possible. So I want to thank each and every one of you for being here for being part of the Giving Tuesday movement and we'll see you in a few short days as Giving Tuesday descends upon us. So thank you so much. I appreciate every single one of you and we'll see you soon.


Shark cartilage supplements are promoted by some alternative medicine practitioners due to their supposed anti-cancer properties. Is there any truth to that? Let's find out. An assessment of websites on complementary and alternative medicine for cancer found that many endorse unproven therapies in some that are outright dangerous, potentially exploiting highly vulnerable patients and enriching irresponsible sneak oil peddlers, or for that matter, shark cartilage peddlers. Accounting for millions of dollars of sales every year, why shark cartilage of all things? Interesting shark cartilage as an anti-cancer agent arose because many people believe that sharks did not get cancer. Why would they think such a thing? Because some shark cartilage supplement hawker wrote a book called Sharks Don't Get Cancer, but that's simply not true. Sharks do get cancer. Both benign and cancerous lesions have been reported in 21 species of sharks, more than nine families. For example, this oral tumor spilling out of the mouth of great white. Now, some shark cartilage distributors insist instead that sharks just rarely get cancer, but actual cancer rates in sharks have never been determined. There's simply been no systematic tumor surveys of sharks for them to make such a claim. But look, even if sharks were less susceptible to cancer, how can one logically jump from that to cancer patients benefiting from eating powdered cartilage from a shark? We know, for example, that there are certain proteins that allow some bacteria to survive like boiling hot springs. Does that mean if we eat those bacteria, we can survive boiling water too? It doesn't make any sense. The ill logic behind the pursuit of shark cartilage therapies have implications beyond the reduction of shark populations and the misdirection of patients to ineffective cancer therapies. The stuff may be harmful. And I'm not just talking about the rare case of shark cartilage-induced liver inflammation. Shark products can contain the neurotoxin BMAA, which I've talked about before. It's been detected at elevated levels in the brains of Alzheimer's disease and ALS patients and may play a role in the development of neurodegenerative disease. So like the consumption of shark fin soup or something may pose a significant health risk, but what about shark cartilage supplements? They tested 16 commercial shark cartilage supplements right off the shelves and found BMAA in 15 out of 16. But look, even if shark cartilage supplements carry pro-inflammatory properties, which could pose a potential health risk for consumers, we're talking about cancer. There are chemotherapy agents that are life-threateningly dangerous, but sometimes the benefits can outweigh the risks when confronted with cancer. So the question then becomes, are there any benefits to shark cartilage? I mean, it's not a completely wacky idea. Cartilage, in general, is highly resistant to invasion by tumor cells. So maybe there's some cartilage-derived anti-invasion factor? Less interesting alternative explanations is that it's just hard for the cancer to penetrate the cartilage, or perhaps because of the poor blood supply in cartilage, cancer doesn't consider it a particularly fertile ground. But maybe that lack of blood vessels in cartilage can be exploited. The reason that no blood vessels end up in cartilage is because cartilage cells produce angiogenesis inhibitors, blood vessel creation inhibitors. And so maybe we can starve tumor growth by infusing these cartilage factors. What scientists do is implant tumors into the eyeballs of rabbits so they can visualize how many blood vessels the tumor is able to draw to itself. And indeed, shark cartilage contains inhibitors of tumor angiogenesis. Such findings made the sales of shark cartilage skyrocket, driving two shark species to the brink of extinction. But cow cartilage does the same thing. Here they use bovine cartilage. And so does human cartilage, for that matter. So why sell shark cartilage? Well, it does sound so much more exotic, and sharks have like 10 times more cartilage per animal. One 20-foot shark could net like 50 pounds of cartilage. Just because cartilage has blood vessel inhibiting chemicals in it, though, it doesn't mean if cancer patients eat it, it will help them. It's kind of like magical thinking. Shark cartilage stops blood vessel growth. Thus, by consuming shark cartilage, humans will somehow be protected. I mean, the shark cartilage's protein molecules would seem to be too large to be absorbed by the gut. It's not like you're injecting shark cartilage into your bloodstream through an IV. But there was this rat study that did find that just feeding shark cartilage to animals, you could cut down a blood vessel growth within their body. Okay, but does that translate out to stopping the growth and spread of cancer? Apparently not, as none of the shark cartilage doses tested had any retarding effect on cancer growth or spread in tumor-bearing mice. But just because it doesn't work in rodents doesn't mean it doesn't work in humans. To find that out, you need to put it to the test, evaluating shark cartilage in human cancer patients, which we'll cover next. When it comes to marketing unproven cancer treatments, the internet has become the wild west. Fraudsters are able to take advantage of people like never before. Cancer patients find quackery on the web, bemoaned the National Cancer Institute. Did you know there were more than 200,000 documents about cancer on the web? What? When was this published? Oh, 1996. It's just a few years after the web was born. Not to worry, though, said the author of Dr. Linden's Guide to Online Medicine. It takes a lot of time and money to maintain a web page, so don't worry. The massive information on the internet will dwindle during the next few years as the internet matures. Right. Yes, a dwindling from 200,000 down to a mere quarter of a billion. And one of the most commonly recommended alternative cancer cures on popular websites is shark cartilage. Much has been made in recent years of the mystical aura afforded to the stuff. Clearly, part of it is the visceral fear of cancer, combined with a healthy respect for a creature that survived basically unchanged since prehistoric times. It's been reported that sharks rarely get cancer and their skeleton is made out of cartilage, and so logic has led some to believe that this must be the reason for sharks' relative health. Not exactly sure that's logical, but they do have a lot of cartilage. Cartilage, in general, has few blood vessels, and blood vessels are important for cancer growth, and all this conspired to prime fraught cancer patients for shameful exploitation by pseudoscience and the supplement industry with the addition of just one myth, and that's sharks don't get cancer. But they do get cancer, after all. Just another layer of fallacious arguments, successfully convincing desperate cancer patients to buy ineffective products. But wait, you don't know if it's ineffective until you put it to the test. 60 patients with a variety of advanced cancers given like a dozen scoops a day of shark cartilage, and not a single, even partial response was noted in any of their tumors. Ineffective, with no salutary effect on the quality of life, in fact suffering significant gastrointestinal toxicity from the stuff. All the while, the tumors progressed in all the patients. But what's missing from this survival graph? What happened in the control group? There was no control group. So while this is what you'd expect to see in advanced cancer patients, how do we know the cancers wouldn't have progressed even faster without the shark cartilage? That's why we need randomized controlled trials, but there weren't any, until the Mayo Clinic stepped up. A randomized placebo-controlled double-blind clinical trial for patients with incurable breast or colorectal carcinoma. Data on a total of 83 patients was analyzed, and there was no difference in survival between patients getting shark cartilage versus those getting placebo, nor any suggestion of improvement and quality of life. There was evidently a prostate cancer study, too. Only five patients were even able to complete the study, and in all five, their cancers continued to progress unabated. So unfortunately, the claims for benefits of shark cartilage are completely unsubstantiated by any objective data from controlled clinical trials. Not so fast said supplement manufacturers. Maybe these crude commercial shark cartilage powders just don't have high enough levels of whatever active components there may be, so cancer patients should instead be taking shark cartilage extract pills. So the National Cancer Institute said, fine, we'll test that too, just to make absolutely sure, and so they funded a randomized double-blind placebo-controlled trial to put it to the test. Unlike the other shark cartilage dietary supplement studies, they used the purified extract, and the study outcome was unambiguous. It failed. The shark cartilage group lived 14 months, and the placebo group lived 15 months, so no significant difference in survival, or to time progression, or tumor response rate. So these clinical studies suggest shark cartilage is not just an unproven cancer remedy, but actually a well-disproven one. Yet despite the overwhelming evidence to the contrary, such claims persisted.  Perhaps the only cure for this myth is to spread the rumen that cartilage from the noses of such quacks fights cancer too. Anyway, if you really want to eat angiogenesis inhibitors, why sit down to a bowl of cartilage powder when you could just eat an apple, or drink green tea, or turmeric, or pomegranates, berries and nuts, soybeans, flaxseeds, broccoli, all of which have been shown to have anti-angiogenic effects.


In this segment, we will see how to train a recurrent neural network with an easy example. We will start by introducing our study case, which means the problem we will try to solve with a recurrent neural network training. Then we will review how to use OPTIM for training a neural network, and in this case a recurrent neural network. Then we will run the code and see the output. We will try also to change some hyperparameters and see their corresponding results. Finally, we will delve deep into the code and we will see how everything works together. So let's introduce our learning problem. We are going to have a sequence-to-sequence case. So we are going to start from a sequence here, which is sent to the hidden layer. We are going to just use one hidden layer. And then we expect to output a prediction based on the current input and from the previous input. So what is our task? So our X is going to be a sequence of characters. For example, A, B, A, B, B, A, A. And let's say we would like to be able to recognize the sequence of letters that make the word ABBA, like the famous music band. So more specifically, we would like that when we see this last character, the last A of the word ABBA, we would like our model to output two instead for all the other cases. We just output A1. So let's say this one is our sequence of label. If we get it right, like here I expect a two and I actually get my natural prediction two, then I'm going to highlight these four letters in one way. If instead I predict the last one to be the correct sample, I will have to say that these letters here are a false positive. Instead, we can have that if I have to predict a number two here and I don't predict, so I predict a one, I will highlight these four letters as a false negative. So in our visualization, we will have to take care of true positives, false positives, true negative, which are actually the only one that we won't be highlighting. And then we have false negatives. And we will see how we can do so in the UNIX environment. So actually our X has to be one hot encoding. So this sequence that we have just written here on the left-hand side. So let's write it here. It was ABBABA. We had to correspond to a 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, for example, and so on. Our labels are going to be... So for the first one we have 1, for the second one we have 1, third one is going to be 1, fourth one is going to be 1, fifth one. Then we have the sixth, we have a two, and then again a one, and so on. So our target labels are going to be one for all the sequences that don't correspond to the ABBA sequence. And then it's going to be turning two when the sequence has been found. So we call it this, find ABBA sequence. Problem. So how do we plan to train such a system? We have seen for convolutional neural network that we can use very efficiently the OPTIM package. We will do here the same, and therefore we will follow a very similar workflow. Let's summarize it just for convenience. So at the beginning, in the training part, we are going to have get dataset. This is a train. Then we are going to craft our model, our current neural network, together with its time replica. We have to reset our state, initial state, because we start from a clean network. So we haven't seen any sequence before. Then we should get the parameter in a vectorial form and not anymore as a collection of objects and the gradient parameters. So the partial derivative of the error with respect to the global vectorial parameter. Then we will define our function eval to which we send theta as argument and which returns error e and the partial derivative of the error with respect to the vectorial form of the parameters. And finally, we can run our optimizer for testing purposes. We just need to get the dataset. In this case is the validation and then reset the state. Since the state would have been polluted by the training at this time of the code. We are going to feed each example of x one at a time to the RNN and we don't need anymore the time replica format. As we have said in the previous video, we can find the code at the elab website under the torch seven demo repository and in the folder rnn-train-sample. Let's start by having a look at how this program runs. So let's call th main. We have the training progress and here we have the output notation. We can observe in green the true positives in white simply the true negative in white with red background the false positives, which means the network tells that the sequence is positive but it is not and then underline it's the false negative. Basically it's when the network doesn't recognize the sequence. So in green again is when the network recognize the sequence in white is when the network do not identify wrongly any sequence. Red background is when a sequence has been identified as positive but it's not and the underline it's when a sequence has not been recognized. As we can see here from this the sequence BAAPBB and then we have twice ABBA that is has been recognized so it is in green. Then there is one more ABBA which has not been recognized therefore is underline. Then we have a B and then three B's followed by IA which the network thinks it's ABBA it's not and therefore it is highlighted in red background. Then it correctly identify true negatives so we have all a white sequence. Then correctly identify the ABBA sequence and we go on like this up to the end of the sequence. Let's see how this training is implemented. This is the main .lua file. We require NNGraph and Optime so we can use them both in this script. We set a torch manual seed of six in order to have repeatability of this script. If you run this script you will observe the same result that I'm showing you right now. Then we set the torch default tensor type to float tensor. This is a common practice in machine learning. We do not require very high precision during computation. Moreover there are set of hyperparameters and is the dimensionality of the input that is two. D is the dimensionality of the hidden representation. Then we have number of hidden layers so we have just one hidden layer. And then K is the output dimensionality that is again two. N is two because it can be A or B so the notation since it's one hotend coding will be one zero or zero one. In the same way we will have for K a dimensionality of two because we will have a probability distribution across the classes. T is the maximum length of the sequence which is equal four since ABBA has four characters. The training size is set to ten thousand and the testing size is set to two hundred and fifty. Let's see what happens if we change the hidden dimensionality going from two to three. We run again the script and we have all correct predictions. So we have seen now that one singular hidden layer with three neurons is able to solve this simple problem. Let's go back to the previous screen. We set a learning rate of 0.02 and a smoothing factor of 0.95 which are then sent to the optimum state. We define some coloring shortcuts that are showing you the different colors of the background and the underlying features. Then we do data equal require data and then we call data dot get data with the training size and the maximum length of the sequence. And we expect to receive x and y so let's have a look to data and here we have data. So the function get data defines a torch tensor of dimensionality size of the training which is filled with ones and twos randomly. We define a Y which is a tensor of ones and then if we do find from the fourth position to the last element of the training size. The sequence a b b a or one two two one then we set the corresponding label of Y to two. Then we define our X. X is going to have as many rows as the training size and as many columns as the features. Since it's a one hotend coding with two symbols we will have just two columns. So for the first to the last feature if the symbol is a then we are going to set a one so basically it's going to be a one zero. Otherwise if the feature is a B so it's a two we are going to set zero one basically and then we return X and Y. And then we have RNN equal require RNN and then we have that we call the get model from the RNN package we have brought with the dimensionality of the input, the dimensionality of the hidden layer, the number of hidden layers, the dimensionality of the output K and the max length of the sequence T. And then the output is going to be a model which is the prototype clone over the capital T time steps and the prototype which is one of these long models. Then we define a criterion which is a negative log log equal class criterion. So it's our classical cross entropy. If you don't know what is a cross entropy criterion just check CNN loss video lecture. Then we get our one dimensional vectors containing the weights of the model and the grad parameters which are the derivatives of the loss function with respect to the parameters. And then we print on screen the number of elements that are in W. So the number of parameters. We then define H zero and H shables and we fill them with answers of zeros. So these are the initial state and the current state of the network. But since we haven't started using the network, we are going to fill them with zeros. Then we forward our first four samples in the network that is clone over time and in the prototype so that we can plot the two graphs with full annotations. Let's have a look at these two graphs. This is the prototype. We can see that after the first reverse maps and splits, we have the X of T in orange on the left hand side. And then on the right hand side we have in red the first and actually only hidden layer at the time step T minus one. These two inputs are fed inside a joint table which is then sent to a linear which is then sent into a nonlinearity which computes the first hidden layer output at time T. If we would have had more layers then it would have stacked one after each other. The output of the first and only hidden layer then it's sent to another linear and then to the final log softmax which allows us to use the cross entropy criterion. Here we have the full model clone over time. In blue we are going to see the RNN prototypes. So we have RNN one, RNN time step two, RNN time step three and RNN time step four. To the first RNN time step one we are going to feed the previous value of the hidden state and then we send also the first element of our sequence X of one. Then the output of the RNN, the red circle which contains the hidden layer at the time step one. It's fed together with the second element of our X tensor into the second clone RNN two. The output of RNN two which is the H at time two. It's fed into the RNN three together with the X at time three. Finally in the last H of time three together with the X at time four. It's fed into the RNN four which produce the last output H. Moreover each of these RNN blue blocks produce the Y prime softmax output. So we are going to have here Y hat one, Y hat two, Y hat three and Y hat four which we are going to be using in order to train and to write the prediction at the testing time. Here we define two helper functions. One allows me to go from tables to tensors and the other one allows me to go from tensor to table. It also adds some zeros that are going to be sent into the state when we perform the propagation. We will see this in a few line of code. Here we initialize our training error to zero. Then we go from the first element to the last element of our training set with a time step of capital T. We are going to narrow the whole dataset X along the first dimensionality. We start from the item iteration and we take just capital T element. We do the same for the Y tensor. We define then our F evaluation. We set our model to training mode. Then we have our current state which is going to be the collection of the output Ys followed by the H's states. It's going to be equal our model to which we forward our X sequence and we unpack the tables of H. In this case we just have one hidden layer so we just send there one tensor. But in the case you would have chosen multiple hidden layers the unpack would have sent separately each and every tensor. Then we have the prediction. We convert the states table which contains the Y prediction and the H hidden states into just prediction. So we basically extract just the prediction from the states. Then we compute the error via the criterion to which we forward the prediction and the Y sequence. Perform the backward pass. We compute the gradient of the error with respect to the output of the system by forwarding again the prediction and the labels to the criterion using the backward method. Then we convert the output tensor from the criterion into a table which we are going to use in order to perform back propagation to the model. But before sending it into the model we have zero degrade parameters in order to perform stochastic gradient descent. Otherwise people would have been accumulating degrade parameters over the previous values. Finally we take care of storing all the hidden layers state into the H table. In this way when we go back above and we unpack H we are going to unpack the current state of the network and we do not have a zero state every time we switch to the next sequence. And that's it we simply call OPTIM with the RMS PROP optimization function to which we provide the function evaluation, the parameters W and the OPTIM state which was containing the learning rate and the learning rate decay. Now we go to testing. We start our testing by setting the model and the prototype to evaluation so we turn off any kind of training related features. We again initialize our hidden state to the H0 state which is a table of tensors set to zero. Moreover we require a new dataset of size test size which was 150 so in order to be able to test our system on data that is not the training data. Then we define some pointers for the queue we are going to use later in order to visualize nicely the result. And here we have the test function. It gets the first element of the X validation set and it sends to the prototype which is one of the RNN replicas. It sends the first symbol of the sequence together with the state of the network which we start from a zero state. And then we obtain the output which contains the next state and we cache it and then we extract the prediction by checking the value after the states. Then we check whether the first symbol was a one zero or zero one. We convert it to the character A or B. Then if we are just processing the first three elements of the whole validation set we insert them into our sequential buffer and we do not do anything. Otherwise if we are at the fourth symbol we can start evaluating whether the sequence is correct sequence or it's a bad sequence. Index is the max index of the prediction so prediction is going to be a log likelihood and we take the max. So if the index is equal to the label then we are going to draw it in green. Otherwise if we got it wrong there are two cases. One case is that the label is two so it's basically we have a sequence but we haven't identified the sequence so we have a false negative. Or otherwise if it's not a two we have identified a sequence then we have a false positive. And then we update the pointers. We get the next value from the queue and we write it on the screen. At the end we simply print the legend or the visualization and we iterate the test function over the test size dimension. And let's run it once more. Since we have restored the dimensionality of the hidden state to two we are going to see again different mistakes. So we train here. Number of parameters are 16. It's a very small network. And then we can see again we have a true negative, true positive. Then we have a false negative. We didn't see the ABBA coming. Then we have again a true negative and then we got a false positive. The output of the network was saying that it was a positive but it was not there. And that's it. Thank you for listening.