Git Product home page Git Product logo

Comments (1)

maorgranot1 avatar maorgranot1 commented on May 26, 2024

For me 'modrelu' became functional again when I replaced it's code in cvnn/activations.py

from :
"
def modrelu(z: Tensor, b: float = 1., c: float = 1e-3) -> Tensor:
abs_z = tf.math.abs(z)
return tf.cast(tf.keras.activations.relu(abs_z + b), dtype=z.dtype) * z / tf.cast(abs_z + c, dtype=z.dtype)
"

to:
"
def modrelu(z: Tensor, b: float = 1., c: float = 1e-3) -> Tensor:
abs_z = tf.math.abs(z)
r_relu = tf.keras.activations.relu(abs_z + b)
return tf.complex(r_relu * tf.math.real(z) / (abs_z + c), r_relu * tf.math.imag(z) / (abs_z + c))
"

It might be less efficient but it solved the bug for me.

from cvnn.

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.