Giter VIP home page Giter VIP logo

Comments (3)

parthe avatar parthe commented on September 28, 2024
import numpy as np
from sigpy.prox import L2Reg
import unittest

def g_in(r_in_minus, gamma_in_minus):
    eta_in_plus = (1 + gamma_in_minus)
    xhat_in_plus = r_in_minus * gamma_in_minus / eta_in_plus
    return xhat_in_plus, eta_in_plus

class TestingDenoisers(unittest.TestCase):

    def test_g_in(self):
        N=10
        operator = L2Reg((N,1), 1.)
        r = np.random.randn(N,1)
        gamma = abs(np.random.randn())
        xhat, eta = g_in(r, gamma)
        C = np.cov(r, xhat, rowvar=False)
        eta_check = gamma/(C[1,0]/C[0,0])
        self.assertAlmostEqual(eta_check, eta)
        self.assertAlmostEqual(np.linalg.norm(xhat-operator(1/gamma, r)),0.)

if __name__ == '__main__':
    unittest.main()

from sigpy.

sidward avatar sidward commented on September 28, 2024

Hello! Thanks for the report. Are you open to making a pull request for your requested document changes? In particular, if you're able to change the documentation for all the "basic proxs" listed in https://sigpy.readthedocs.io/en/latest/core_prox.html to be of the format "prox_{alpha g)(y) = argmin...", that would be much appreciated.

from sigpy.

parthe avatar parthe commented on September 28, 2024

I created a pull request

from sigpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.