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 22:06] humphrey [Understand OOP in Tensorflow(Extra credit)] |
cs501r_f2017:lab04 [2021/06/30 23:42] (current) |
||
---|---|---|---|
Line 26: | 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 219: | 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. |