$30 off During Our Annual Pro Sale. View Details »

JGS594 Lecture 05

JGS594 Lecture 05

Software Engineering for Machine Learning
Coding
(202201)

Javier Gonzalez-Sanchez
PRO

January 27, 2022
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    SER 594
    Software Engineering for
    Machine Learning
    Lecture 05: Assignment 01
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View Slide

  2. jgs
    Previously …

    View Slide

  3. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 3
    jgs
    Next
    From
    Scratch

    View Slide

  4. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 4
    jgs
    Neural Network

    View Slide

  5. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 5
    jgs
    Code
    https://github.com/javiergs/Medium/blob/main/NeuralNetwork/BasicNeuralNetwork.java

    View Slide

  6. jgs
    Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 6

    Go for a value < 0.05

    View Slide

  7. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 7
    jgs
    Constructor

    View Slide

  8. jgs
    Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 8

    View Slide

  9. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 9
    jgs
    Main
    10,000
    4
    1

    View Slide

  10. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 10
    jgs
    Backward
    Forward Propagation
    Error
    Forward Propagation
    Error
    Forward Propagation
    Error
    Main
    Forward
    Propagation
    Error
    MSE
    10,000 times
    Backward
    Backward
    Backward
    Propagation

    View Slide

  11. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 11
    jgs
    Forward Propagation

    View Slide

  12. jgs
    Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 12

    View Slide

  13. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 13
    jgs
    Backward Propagation (Part 1 of 2)

    View Slide

  14. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 14
    jgs
    Backward Propagation (Part 2 of 2)

    View Slide

  15. jgs
    Assignment 01

    View Slide

  16. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 16
    jgs
    Instructions
    § Use the code from
    https://github.com/javiergs/Medium/blob/main/NeuralNetwork/BasicNeuralNetwork.java
    § Write a paper addressing the following questions

    View Slide

  17. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 17
    jgs
    Questions
    1. Can you reuse that code and train a neural network for identifying AND
    operator? What is the Error after 10,000 iterations of training?
    2. Can you reuse that code and train a neural network for identifying OR
    operator? What is the Error after 10,000 iterations of training?
    3. Compare with the provided error for XOR.
    Explain the difference or similarities

    View Slide

  18. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 18
    jgs
    Questions
    For the error calculation. You will notice this code
    meanSquareError += Math.pow (err, 2)/2;
    double err1 = meanSquareError / (network.nodesOutputLayer+network.nodesHiddenLayer-1);
    4. Is there a problem there?
    5. Could you identify and explain or fix?

    View Slide

  19. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 19
    jgs
    Questions
    6. What is the size of the array arrayBias?
    Is that, OK?
    Should it or Could it Be smaller?
    If so, can you fix the code? It is worthy to make it smaller.

    View Slide

  20. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 20
    jgs
    Questions
    7. Plot the values of the eight W values
    Describe/notice how they change.

    View Slide

  21. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 21
    jgs
    Questions
    8. Express the source code from lines 64 to 75 as an equation using the
    names on the picture
    9. Express the source code from lines 77 to 88 as equations using the
    names on the picture
    10. Express the source code from lines 90 to 93 as equations using the
    names on the picture

    View Slide

  22. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 22
    jgs
    Extra
    If you are familiar with derivatives,
    § Can you explain the equations from the previous question (where they come
    from)
    Hints:
    o derivative of sigmoid function;
    o partial derivative of error function with respect to Wi
    o Derivative of a constant
    o Derivative of (Ax + Bx + Cx + …)

    View Slide

  23. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 23
    jgs
    Picture

    View Slide

  24. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 24
    jgs
    Questions

    View Slide

  25. jgs
    Summary

    View Slide

  26. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 26
    jgs
    Data Scientist vs Engineers

    View Slide

  27. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 27
    jgs
    Roles

    View Slide

  28. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 28
    jgs
    Use

    View Slide

  29. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 29
    jgs
    Use

    View Slide

  30. Javier Gonzalez-Sanchez | SER 594 | Spring 2022 | 30
    jgs
    Use

    View Slide

  31. jgs
    SER 594 Software Engineering for Machine Learning
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Spring 2022
    Copyright. These slides can only be used as study material for the class CSE205 at Arizona State University.
    They cannot be distributed or used for another purpose.

    View Slide