Comments (4)
Update, I think this is due to the way pyphi catches things, (but I don't know how to turn this on and off yet)?
I generated and stored 100, random tpm
s and state
s, and then ran the above on them, and got much more common sense times,
>>> compute_big_mip()
33.894142627716064
>>> compute_big_mip_and_a_random_cut()
31.76900362968445
So I'll close this, as it seems like it's really use case confusion, rather than problem with pyphi
from pyphi.
Oh dear maybe I spoke too soon? Now if I calculate the random cut only, it still seems very slow,
>>> def compute_a_random_cut_only():
... start = time()
... for t in range (0,100):
... network = pyphi.Network(tpms[t], connectivity_matrix=cms[t])
... subsystem = pyphi.Subsystem(network, states[t], range(network.size))
... #mip = pyphi.compute.big_mip(subsystem)
... i = randint(0, num_all_directed_bipartitions-1)
... rand_bipartition = all_bipartitions[ i : i+1 ] # random directed bipartition
... random_cut = [ pyphi.models.cuts.Cut ( bipartition[0], bipartition[1] ) for bipartition in rand_bipartition ] # random_cut
... unpartitioned_constellation = pyphi.compute.constellation(subsystem)
... mip_of_rand_cut = evaluate_cut(subsystem, random_cut[0], unpartitioned_constellation) # pyphi/compute/big_phi.py#L27
... print(time()-start)
...
>>> compute_a_random_cut_only()
30.439067840576172
I would have expected it to be much faster if it's only got to calculate one random cut, and not the full subsystem's big_mip
. Any ideas where all the computation time is going?
from pyphi.
Hi Ajay,
I finally had a chance to look into this, and I can't seem to reproduce it. I wrote a similar script, and I see results more in line with what we'd expect:
Timing functions (4 nodes, 100 iterations)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
big_mip: done.
Mean time: 0.6552s
naive_big_mip: done.
Mean time: 0.7885s
unpartitioned_constellation: done.
Mean time: 0.0965s
random_cut: done.
Mean time: 0.0680s
When the script is run with 5 nodes rather than 4, I get similar results:
Timing functions (4 nodes, 100 iterations)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
big_mip: done.
Mean time: 31.5975s
naive_big_mip: done.
Mean time: 32.6524s
unpartitioned_constellation: done.
Mean time: 2.0442s
random_cut: done.
Mean time: 0.9371s
from pyphi.
Hi Will, @wmayner,
sorry for the late reply - I'm not ignoring you - I got caught up in something else. I'm looking into this now, and going to reply to your email soon.
It's great that you've got the pyphi-users forum rolling - maybe you want to put a link to it on the front page here to let new users know it exists?
Best,
Aj
from pyphi.
Related Issues (20)
- Import error HOT 1
- Python3.12: Tests fail HOT 2
- Version 1.2.1 has never been released
- pyphi execution hangs after outputting one line HOT 2
- Scalability to large network HOT 6
- The readme instructions for installing via conda fails HOT 1
- pyphi-users mailing list HOT 2
- where is PQR cause-effect space on fpga with φ? HOT 2
- Compute relations up to a certain order HOT 1
- Indicate when a connectivity-based optimization was used for MICE with phi = 0
- Support for different ways of computing phi?
- Python 3.8 multiprocessing breaks configuration system with parallelization on macOS
- Error when trying to receive TPM using json HOT 1
- 1.2.0: failing test on s390x (Big endian): ERROR collecting test/test_subsystem_phi_max.py HOT 3
- Error import network.json file in the ipython or python HOT 2
- export network file to ghephi format supported
- Key Error ID from network.json using ipycytoscape in Jupyter Lab
- ValueError: math domain error HOT 1
- AttributeError: module pytest has no attribute lazy_fixture
- atomic_write_yaml() fails to move fresh pyphi_config.yml ? HOT 2
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 pyphi.