Comments (3)
from c3.
One thing to keep in mind is that the python structure is not necessarily the tensorflow structure. The examples above use decorated @tf.functions
which means they will be parsed as a for loop but not executed that way. It all comes back to the fact that we need a proper software engineer to find the best tensorflow network representation for the propagation.
Below is an example notebook but that's about as far as I got investigating this.
import numpy as np
import tensorflow as tf
import time
slices = 3000
var = tf.Variable(np.random.rand(100,100))
def expm(var):
return tf.linalg.expm(var)
@tf.function
def tf_expm(var):
return tf.linalg.expm(var)
start_time = time.time()
res = []
for ii in range(slices):
res.append(expm(var))
print(time.time() - start_time, "seconds")
19.600555658340454 seconds
start_time = time.time()
res2 = []
for ii in range(slices):
res2.append(tf_expm(var))
print(time.time() - start_time, "seconds")
4.85532021522522 seconds
var_vec = tf.Variable(np.random.rand(slices, 100,100))
def expm_vec():
return tf.vectorized_map(expm, var_vec)
start_time = time.time()
res_vec = expm_vec()
print(time.time() - start_time, "seconds")
WARNING:tensorflow:Using a while_loop for converting ResourceGather
6.617619276046753 seconds
@tf.function
def expm_tf_vec():
return tf.vectorized_map(expm, var_vec)
start_time = time.time()
res_vec_2 = expm_tf_vec()
print(time.time() - start_time, "seconds")
WARNING:tensorflow:Using a while_loop for converting ResourceGather
6.34708309173584 seconds
from c3.
@GlaserN Is this issue fixed in #34?
from c3.
Related Issues (20)
- CI takes too long (drop Ubuntu 18.04)
- Piecewise Constant Pulses through Qiskit Interface
- Tutorial docs missing notebooks from examples
- Frequency specified response function
- Call of set_opt_map() breaks experiment for further simulations
- Interaction picture
- Missing lindbladian evolution
- Large numbers of parameters unreadable
- Missing get Hamiltonian for a signal input
- Wrong definition of the lindblad coefficient for T1
- Ideal gate assignment missing in Instruction class constructor
- Wrong sign in xy_angle in phase in Instruction class
- Updating Instruction name directly doesn't update its ideal gate
- CMAES optimisers can silently make parameters be OOB HOT 1
- Slow test due to Response
- PWC optimization - printing parameters for non gradient based algorithm
- Errors when amplitude of slepian shaped pulses is zero
- Problems in examples/Full_loop_single_qubit.ipynb
- Migrate to Qiskit 1.0
- Problem in example code possibly due to newer version of tensorflow
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 c3.