Skip to content

Commit

Permalink
Make install
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelVaroquaux committed Aug 24, 2012
1 parent a19b728 commit 5d0eada
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 277 deletions.
Binary file modified _downloads/PythonScientific-simple.pdf
Binary file not shown.
Binary file modified _downloads/PythonScientific.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions _downloads/cost_functions.py
Expand Up @@ -20,18 +20,21 @@ def gaussian_prime_prime(x):

def mk_gauss(epsilon, ndim=2):
def f(x):
x = np.asarray(x)
y = x.copy()
y *= np.power(epsilon, np.arange(ndim))
return -gaussian(.5*y) + 1

def f_prime(x):
x = np.asarray(x)
y = x.copy()
scaling = np.power(epsilon, np.arange(ndim))
y *= scaling
return -.5*scaling*gaussian_prime(.5*y)

def hessian(x):
epsilon = .07
x = np.asarray(x)
y = x.copy()
scaling = np.power(epsilon, np.arange(ndim))
y *= .5*scaling
Expand All @@ -48,11 +51,13 @@ def hessian(x):

def mk_quad(epsilon, ndim=2):
def f(x):
x = np.asarray(x)
y = x.copy()
y *= np.power(epsilon, np.arange(ndim))
return .33*np.sum(y**2)

def f_prime(x):
x = np.asarray(x)
y = x.copy()
scaling = np.power(epsilon, np.arange(ndim))
y *= scaling
Expand Down
3 changes: 2 additions & 1 deletion _sources/advanced/mathematical_optimization/index.txt
@@ -1,3 +1,5 @@
.. _mathematical_optimization:

==========================
Mathematical optimization
==========================
Expand Down Expand Up @@ -812,7 +814,6 @@ Synthetic exercices
.. image:: auto_examples/images/plot_exercise_ill_conditioned_1.png
:scale: 42%
:target: auto_examples/plot_exercise_ill_conditioned.html
:align: right

.. topic:: **Exercice: A simple (?) quadratic function**
:class: green
Expand Down

0 comments on commit 5d0eada

Please sign in to comment.