Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please, recreate this example in python. Have it generate the same plots as well. Linear Network Figure 10 displays a set of 100 examples drawn
Please, recreate this example in python. Have it generate the same plots as well.
Linear Network Figure 10 displays a set of 100 examples drawn from two Gaussian distributed classes centered at (0.4,0.8) and (0.4,0.8). The eigenvalues of the covariance matrix are 0.84 and 0.036. We train a single layer linear network with 2 inputs, 1 output, 2 weights, and 1 bias (see Figure (9)) using the LMS algorithm in batch mode. Figure 11 displays the weight trajectory and error during learning when using a learning rates of =1.5 and 2.5. Note that the learning rate (see Eq. 38) max=2/max=2/.84=2.38 will cause divergences as is evident for =2.5. Fig. 9. Simple linear network. Fig. 10. Two classes drawn from gaussian distributions centered at (0.4,0.8) and (0.4,0.8). Figure 12 shows the same example using stochastic instead of batch mode learning. Here, a learning rate of =0.2 is used. One can see that the trajectory is much noisier than in batch mode since only an estimate of the gradient is used at each iteration. The cost is plotted as a function of epoch. An epoch here is simply defined as 100 input presentations which, for stochastic learning, ] corresponds to 100 weight updates. In batch, an epoch corresponds to one weight update. Fig. 12. Weight trajectory and error Fig. 13. Weight trajectories and errors curve during stochastic learning for = for 1-1-1 network trained using stochas0.2. tic learning
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started