This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cs501r_f2017:lab04 [2017/09/16 21:42] humphrey [Deliverable] |
cs501r_f2017:lab04 [2021/06/30 23:42] (current) |
||
---|---|---|---|
Line 8: | Line 8: | ||
====Deliverable==== | ====Deliverable==== | ||
Finish task 1 to 5, zip up all your code and ipython script together with the result of task 4, which is a tuple of 3 numbers (w1, w2, b), then submit that on learning suit. Task 5(extra credit) worth 5% of the total grade of this lab.😊 | Finish task 1 to 5, zip up all your code and ipython script together with the result of task 4, which is a tuple of 3 numbers (w1, w2, b), then submit that on learning suit. Task 5(extra credit) worth 5% of the total grade of this lab.😊 | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====Grading standards:==== | ||
+ | |||
+ | Your code will be graded on the following: | ||
+ | |||
+ | * 30% Correct implementation of data generator | ||
+ | * 30% Correct implementation of regression estimator | ||
+ | * 10% Correct implementation of multi values regression estimator | ||
+ | * 10% Fully vectorized code | ||
+ | * 20% Correct estimation of hidden parameters in foo.csv | ||
+ | * +5% Clean factorization of computation graphs into classes | ||
---- | ---- | ||
Line 13: | Line 26: | ||
===Key concepts:=== | ===Key concepts:=== | ||
- | Computation graphs: A computation graph is essentially an electric circuit, or you can think of it as a dynamical system if you are a math student. Given that, there are three things we want to do with it: first, feed it with some inputs; second, measure the readings of its output nodes; third, trigger some operations on occasions for more control on the graph/circulatory/system. | + | Computation graphs: A computation graph is essentially an electric circuit, or you can think of it as a dynamical system if you are a math student. Given that, there are three things we would like to do with it: first, feed it with some inputs; second, measure the readings of its output nodes; third, trigger some operations on occasions for more control on the system. |
- | Sessions: It provide a framework to send and read signals to/from a graph, and it has very similarly syntax as a file stream. | + | Sessions: It provides a framework to send and read signals to or from a graph, and it has very similarly syntax as a file stream. |
Placeholders: They are the input ports of a graph. Each time we run a computation graph with the goal of triggering an operation or measuring a set of nodes, it’s required to send in the request with an input dictionary, specifying what input values are used to generate the outputs. | Placeholders: They are the input ports of a graph. Each time we run a computation graph with the goal of triggering an operation or measuring a set of nodes, it’s required to send in the request with an input dictionary, specifying what input values are used to generate the outputs. | ||
Line 126: | Line 139: | ||
</code> | </code> | ||
- | 4. My computation graph visualization looks like this | + | 4. My computation graph visualization looks like the following: |
{{:cs501r_f2017:hint2.4.png?800|}} | {{:cs501r_f2017:hint2.4.png?800|}} | ||
---- | ---- | ||
Line 191: | Line 203: | ||
===Task 4=== | ===Task 4=== | ||
==Read in the following .csv file and guess the regression line behind the data.== | ==Read in the following .csv file and guess the regression line behind the data.== | ||
- | [[cs501r_f2017:lab04:foo|]] | + | [[cs501r_f2017:lab04:foo|foo.csv]] |
===Hints:=== | ===Hints:=== | ||
Line 207: | Line 219: | ||
decorator pattern: A decorator function takes a function and its arguments then extend its behavior without changing the function's implementation. The @annotation in python does exactly that. | decorator pattern: A decorator function takes a function and its arguments then extend its behavior without changing the function's implementation. The @annotation in python does exactly that. | ||
- | @property annotation: While all variables in an object are visible to its users, we might still want to implement getters and setters with special behaviors, for example, bound checking. The @property allows us to do exactly that. | + | @property annotation: While all variables in an object are visible to its users, we might still want to implement getters and setters with special behaviors, for example, bounds checking. The @property allows us to do exactly that. |
Line 227: | Line 239: | ||
{{:cs501r_f2017:hint5.1.png?800|}} | {{:cs501r_f2017:hint5.1.png?800|}} | ||
- | 2. The article by Danijar have shed great insight about this topic. Solution to the problem should become trivial after reading his article. | + | 2. The article by Danijar have shed great insight about this topic. Solutions to the problem should become trivial after reading his article. |
3. @functools.wraps(function) can be replaced by @six.wraps(function) for python 2 compatibility after installing and importing the python library "six" in your project environment. | 3. @functools.wraps(function) can be replaced by @six.wraps(function) for python 2 compatibility after installing and importing the python library "six" in your project environment. |