コード例 #1
0
#https://github.com/pymanopt/pymanopt/blob/master/pymanopt/core/problem.py

import autograd.numpy as np
from pymanopt import Problem


def cost(theta):
    return np.square(theta)


problem = Problem(manifold=None, cost=cost, verbosity=1)

print problem.cost(5)

print problem.egrad(5.0)
コード例 #2
0
#https://github.com/pymanopt/pymanopt/blob/master/pymanopt/core/problem.py

import autograd.numpy as np
from pymanopt import Problem


def cost(theta):
    return np.square(theta)
    
problem = Problem(manifold=None, cost=cost, verbosity=1)

print problem.cost(5)

print problem.egrad(5.0)
コード例 #3
0
#https://github.com/pymanopt/pymanopt/blob/master/pymanopt/core/problem.py

import autograd.numpy as np
from pymanopt import Problem


def cost(theta):
    return np.square(theta)


problem = Problem(manifold=None, cost=cost, verbosity=1)

print(problem.cost(5))

print(problem.egrad(5.0))