GithubHelp home page GithubHelp logo

Comments (6)

mrkwjc avatar mrkwjc commented on August 17, 2024

Hi! Thanks for reporting! I pushed a solution with custom setuptools commands. Numpy (with f2py), meson and meson-python must be available at installation time. Does this work for you?

from ffnet.

mathomp4 avatar mathomp4 commented on August 17, 2024

Hi! Thanks for reporting! I pushed a solution with custom setuptools commands. Numpy (with f2py), meson and meson-python must be available at installation time. Does this work for you?

Ooh. Thanks! I'll let you know tomorrow...once I figure out how to install meson on the cluster. 😄

from ffnet.

mrkwjc avatar mrkwjc commented on August 17, 2024

meson is pip installable...

from ffnet.

mathomp4 avatar mathomp4 commented on August 17, 2024

Good news, it installs!

Bad news, I think more changes are needed underneath. When I try to load it:

$ python3 -c 'import ffnet'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/discover/nobackup/mathomp4/Miniconda-Test/MINIpyD/24.1.2-0_py3.12/2024-03-22/lib/python3.12/site-packages/ffnet/__init__.py", line 17, in <module>
    import ffnet.ffnet as ffnetmodule
  File "/discover/nobackup/mathomp4/Miniconda-Test/MINIpyD/24.1.2-0_py3.12/2024-03-22/lib/python3.12/site-packages/ffnet/ffnet.py", line 16, in <module>
    from scipy import zeros, ones, optimize, sqrt, ndarray, array
ImportError: cannot import name 'zeros' from 'scipy' (/discover/nobackup/mathomp4/Miniconda-Test/MINIpyD/24.1.2-0_py3.12/2024-03-22/lib/python3.12/site-packages/scipy/__init__.py)

I think these lines:

ffnet/ffnet/ffnet.py

Lines 16 to 17 in 67279ab

from scipy import zeros, ones, optimize, sqrt, ndarray, array
from numpy import random

need to become:

from numpy import zeros, ones, sqrt, ndarray, array
from scipy import optimize

If I do that, the README example works:

$ python3 ffnet_example.py
Feed-forward neural network:
inputs:     2
hiddens:    2
outputs:    1
connections and biases:    9

Testing results for 4 testing cases:
OUTPUT 1 (node nr 5):
Targets vs. outputs:
   1      1.000000      1.000000
   2      0.000000      0.500000
   3      0.000000      0.000001
   4      1.000000      0.499999
Regression line parameters:
slope         =  0.499999
intercept     =  0.250000
r-value       =  0.707106
p-value       =  0.292894
slope stderr  =  0.353553
estim. stderr =  0.353553

(or, I guess, doesn't crash? Not sure what the answer should be).

That said, it's possible my suggested changes might need to be protected with try/except? Not sure when the bits moved from scipy to numpy...

from ffnet.

mrkwjc avatar mrkwjc commented on August 17, 2024

Change must be introduced in >scipy-1.10... Nevertheless, I introduced your changes, without try/except, this always should be written so :)

from ffnet.

mathomp4 avatar mathomp4 commented on August 17, 2024

@mrkwjc Things seem to be working well for me now! Thanks! I'll close this.

from ffnet.

Related Issues (10)

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.