class MicroGrad::Value(T)
- MicroGrad::Value(T)
- Reference
- Object
Overview
Stores a single scalar value and its gradient
Defined in:
micrograd/engine.crClass Method Summary
Instance Method Summary
- #*(other : Value)
- #*(other : Number)
-
#**(other : Number)
Calculate this value's data to the power of the given scalar and return the result as a
Valuechained with the inputs. - #+(other : Value)
- #+(other : Number)
- #-(other : Value)
- #-(other : Number)
- #-
- #/(other : Value)
- #/(other : Number)
-
#backward
Calculate the gradients backwards from this
Value - #data : T
-
#data=(value : Number)
Assign a data value
-
#draw_dot(io, graph_name = "X")
Generate a Graphviz
dotdigraph diagram to the io; the output can be converted to an image using thedottool. -
#exp
Power of e
- #grad : T
-
#grad=(value : Number)
Assign a gradient
-
#log
Natural log
-
#relu
ReLU
-
#sigmoid
Sigmoid
-
#tanh
tanh
-
#to_s(io)
Return a string describing the data and gradient of this
Value
Class Method Detail
Instance Method Detail
Multiple this Value with any Number (internally wrapping that in a Value) and return the result as a Value chained with the inputs.
Calculate this value's data to the power of the given scalar and return the result as a Value chained with the inputs.
Add this Value to any Number (internally wrapping that in a Value) and return the result as a Value chained with the inputs.
Subtract any Number from this Value (internally wrapping that in a Value) and return the result as a Value chained with the inputs.
Divide this Value by any Number (internally wrapping that in a Value) and return the result as a Value chained with the inputs.
Generate a Graphviz dot digraph diagram to the io; the output can be converted to an image
using the dot tool.