8.14

Lecture 28: Designing a neuron🔗

This assignment is due on Tuesday, December 3 at 11:59pm. Submit it using Handin as assignment lecture28.

; A Line is (make-line Number Number)
(define-struct line [intercept slope])
 
; run : Line Number -> Number
(define (run L x)
  (+ (line-intercept L) (* (line-slope L) x)))

Exercise 1. Suppose we want a Line L so that
  • (run L 0) is near 26

  • (run L 10) is near 31

  • (run L 20) is near 40

Which of the following Lines is better: (make-line 20 1) or (make-line 10 2)? Define it as a constant named better-line.

Exercise 2. Make an even better Line than the ones in Exercise 1. Define it as a constant named even-better-line.

The code we will go over in class is available for your reference: for a Line, for a perceptron. To download it, don’t use “Save Page As” or “Save As”; use “Save Link As” or “Download Linked File” in your Web browser. If you can’t find the command, try right-clicking or two-finger-tapping or long-pressing.