Comments (15)
I haven't try that yet. However, I think it can be done similarly once you have set up the proper primitive set (terminals + functions). Just be sure that your function node can operate normally on all the possible inputs and intermediate values.
For example, if your input is a tensor, then the ADD function should also be tensor version, that can accept two tensors, or one tensor plus one scalar. I guess general libraries like PyTorch has support for that already. If not, you need to implement your own ADD function by checking the actual parameter types internally.
from geppy.
Hi Thanks for replying.
where I can find the list of the function? I'd like to know if there is dot, cross, these operator for the tensor?
from geppy.
Besides, I meet the error message during the installation. it says :
....
deap/tools/_hypervolume/hv.cpp:24:10: fatal error: 'cstdlib' file not found
#include
^~~~~~~~~
...
I am trying to install geppy in my MacBook Pro with python2.7
from geppy.
Hi Thanks for replying.
where I can find the list of the function? I'd like to know if there is dot, cross, these operator for the tensor?
Hi, I think you can find these in PyTorch's document. For example: dot operation: https://pytorch.org/docs/stable/torch.html#torch.dot, cross: https://pytorch.org/docs/stable/torch.html#torch.cross
from geppy.
Besides, I meet the error message during the installation. it says :
....
deap/tools/_hypervolume/hv.cpp:24:10: fatal error: 'cstdlib' file not found
#include
^~~~~~~~~
...
I am trying to install geppy in my MacBook Pro with python2.7
looks like it's about deap. You may try pip install deap
to manually install deap first
from geppy.
Thanks for your help @bolz213 .
@waynezw0618 :
I am afraid you have misunderstood the function concept in geppy. This package geppy only defines a function wrapper essentially, which requires a true function that can do the work and the number of arguments needed by this function. That is, you can provide it with any function you like. Please check the examples for some inspiration.
from geppy.
@bolz213 @ShuhuaGao thanks for both
I did not notice that I have to install deep manually before geppy(as I suppose it will automatically install the dependency). but now I manually reinstall deap. and later rebuild and install geppy. still have problem to use geppy properly. here is the error message:
import geppy
Traceback (most recent call last):
File "", line 1, in
File "geppy/init.py", line 37, in
from .core.entity import *
File "geppy/core/entity.py", line 415
nonlocal n_rnc
^
SyntaxError: invalid syntax
from geppy.
from geppy.
@bolz213 @ShuhuaGao thanks for both
I did not notice that I have to install deep manually before geppy(as I suppose it will automatically install the dependency). but now I manually reinstall deap. and later rebuild and install geppy. still have problem to use geppy properly. here is the error message:import geppy
Traceback (most recent call last):
File "", line 1, in
File "geppy/init.py", line 37, in
from .core.entity import *
File "geppy/core/entity.py", line 415
nonlocal n_rnc
^
SyntaxError: invalid syntax
Hi the author of geppy documents that it requires python3.5 and afterwards. See the "Requirements" in the readme
from geppy.
@bolz213 thanks, that works now!
from geppy.
@ShuhuaGao @bolz213
Sorry again seems my installation is not stable. I have installed geppy on MacBook with Mac OS 14.0
I have installed python3.7 manually with numpy-1.16.2,graphviz-0.10.1,sympy-1.4.
as mentioned before, geppy works after installation.
and now the problems, I works only after I install geppy. Once I quit python. I can't even import geppy properly. see below:
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import geppy
Traceback (most recent call last):
File "", line 1, in
File "geppy/init.py", line 37, in
from .core.entity import *
File "geppy/core/entity.py", line 415
nonlocal n_rnc
^
from geppy.
@ShuhuaGao @bolz213
Sorry again seems my installation is not stable. I have installed geppy on MacBook with Mac OS 14.0
I have installed python3.7 manually with numpy-1.16.2,graphviz-0.10.1,sympy-1.4.
as mentioned before, geppy works after installation.
and now the problems, I works only after I install geppy. Once I quit python. I can't even import geppy properly. see below:[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.import geppy
Traceback (most recent call last):
File "", line 1, in
File "geppy/init.py", line 37, in
from .core.entity import *
File "geppy/core/entity.py", line 415
nonlocal n_rnc
^
It's still about the python version. Could you try "python --version" and see its version?
In addition, for convenience of trying something, I recommend you to use conda and create an environment which is isolated and you can try anything inside it. The cool thing is that in this isolated environment you can install packages of certain versions and won't affect other environments.
from geppy.
@ShuhuaGao @bolz213
Sorry again seems my installation is not stable. I have installed geppy on MacBook with Mac OS 14.0
I have installed python3.7 manually with numpy-1.16.2,graphviz-0.10.1,sympy-1.4.
as mentioned before, geppy works after installation.
and now the problems, I works only after I install geppy. Once I quit python. I can't even import geppy properly. see below:[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.import geppy
Traceback (most recent call last):
File "", line 1, in
File "geppy/init.py", line 37, in
from .core.entity import *
File "geppy/core/entity.py", line 415
nonlocal n_rnc
^
The default python version of Mac 14.0 seems python2. You may need to use python3
to invoke python3 (and maybe you need use pip3 install ...
to install geppy for python3). Or a better way is to use conda environment.
from geppy.
@waynezw0618 I guess you are new to Python. Apart from using an environment manager, as said by @bolz213 , you can set the default Python to the 3.7 version. See this stackoverflow How to set Python's default version to 3.x on OS X?.
from geppy.
Hello Again @ShuhuaGao @bolz213
I am trying geppy to fit N 3X3 tensor Bij with two scalar list I1,I2 of size N and two 3X3 tensor list V1,V2 with fitness defined as tensorDot(Bij, PBij)/(tensordot(Bij,Bji)*tensordot(PBij, PBji)). but I get errors in my evaluation function like this:
[[ATraceback (most recent call last):
File "testGEPPY_DNS.py", line 109, in
stats=stats, hall_of_fame=hof, verbose=True)
File "/Users/weizhang/software/backup/geppy-master/geppy/algorithms/basic.py", line 100, in gep_simple
for ind, fit in zip(invalid_individuals, fitnesses):
File "testGEPPY_DNS.py", line 71, in evaluate
Rp_i=np.array([[Yp[i,1],Yp[i,2],Yp[i,3]],[Yp[i,2],Yp[i,4],Yp[i,5]],[Yp[i,3],Yp[i,5],Yp[i,:6]]])
IndexError: too many indices for array
here is my evaluation function:
`
def evaluate(individual):
"""Evalute the fitness of an individual: MSE (mean squared error)"""
func = toolbox.compile(individual)
Yp = np.array(list(map(func,T1,T2,T3))) # predictions with the GEP model
#print (np.shape(Yp),Yp)
a=0
b=0
c=0
for i in range(size):
Ri=np.array([[bij[i,1],bij[i,2],bij[i,3]],[bij[i,2],bij[i,4],bij[i,5]],[bij[i,3],bij[i,5],bij[i,6]]])
Rp_i=np.array([[Yp[i,1],Yp[i,2],Yp[i,3]],[Yp[i,2],Yp[i,4],Yp[i,5]],[Yp[i,3],Yp[i,5],Yp[i,6]]])
# print (Ri,np.shape(Ri))
a=a+np.tensordot(Rp_i,Ri)
b=a+np.tensordot(Ri,Ri.T)
c=c+np.tensordot(Rp_i,Rp_i.T)
return a/(b*c),
`
I tried to print the PB, seems give me a array of(N,1) rather than expected (N,3,3)
can you please give me some suggestion
from geppy.
Related Issues (20)
- How can I add functions such as SQRT, EXP, X^2, POW, INV, LN in my code of Gene Expression Programming HOT 3
- after add function of log, problems occured to visualize HOT 6
- can you explain the gep_simple method outputs-nevals? HOT 1
- How can I run the setup.py HOT 3
- how to generate all the expressions on a given primitive set? HOT 6
- how to assign some illegal operation which would not be search HOT 7
- what is the difference of GP and GEP in Engineering(running)? HOT 4
- Any settings or solutions for 'De-duplication' in the Hall of Fame? HOT 4
- If I changed your source code a littile, is it right to re-install from source again? HOT 2
- question: limit function parameter to const integers HOT 4
- Save an individual, or how to create an individula knowing its expression HOT 2
- How how can I know that geppy converges
- Support types if input and output of functions HOT 1
- raise TypeError, ("Both weights and assigned values must be a "
- possible to use computer programming language to modify gene of human
- question about "minimize" HOT 1
- Questions about using numba to speed up evaluation functions HOT 1
- GPU acceleration HOT 1
- Modifying the number of genes in GEP code produces error HOT 2
- Modifying the number of genes in GEP code produces error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geppy.