Random Ideas
Comparison with the Power equations.
\[ f(n) = constant^{n} \]
Observations
- The constant if less than 1 then it inverts
- If constant is 1 then the equation is flat
- Higher the constant higher the slope
graphs= sym.plotting.plot(sym.exp(n), 2**n, 0.1**n,1**n,2.3**n,2.67**n,(n,0.0,1), title="Exponential", legend= True, xlabel='n', ylabel='f(x)', show=False)
for i, graph in enumerate(graphs):
graph.line_color=color[i%len(color)]
graphs.show()
Converting the power equation to loss function
- Inoder to the make the loss function, for higher slope lines the loss at zero should be lesser
- so the highest slope equation should have lowest loss
- This is achieved by adding the inverse of the constant to the loss
\[ f(n) = constant^{n} + \frac{1}{constant} \]
n, x = sym.symbols('n, x')
loss = n**x + 1/n
#n hasto be grater than 1
graphs = sym.plotting.plot(loss.subs(n,1.),
loss.subs(n,1.5),
loss.subs(n,2.),
loss.subs(n,3.),
loss.subs(n,4.),
loss.subs(n,10.),
(x,-1,1), title="Power Los", legend= True, xlabel='x', ylabel='f(x)', show=False)
for i, graph in enumerate(graphs):
graph.line_color=color[i%len(color)]
graphs.show()