-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Euler Sample Path does not work under TensorFlow 2.0 with Higher Dimension #14
Comments
I have pushed a fix for this (we needed to replace tf.name_scope with tf.compat.v1.name_scope). Can you please give it another spin (against the head version and not the pip version) and let me know if it still doesn't work. |
Even worse, I can't import the library. ----> 1 import tf_quant_finance as tqf ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/init.py in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/init.py in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/init.py in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/sobol/init.py in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/sobol/sobol_impl.py in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/sobol/sobol_impl.py in _load_sobol_data() |
Hi @jjchan121, we tried to reproduce your last error in an environment similar to yours (ubuntu, anaconda, latest pip package installed within anaconda). However, the "import tf_quant_finance as tqf" statement works in this environment. Could you please provide more details about your environment? We would need the following information:
Ideally, we would get a sequence of commands that can completely reproduce the environment in which the "import tf_quant_finance as tqf" statement fails. As a temporary workaround, you could just comment out the line 224 (line with _load_sobol_data()) in ~/.conda/envs/idp36p/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/sobol/sobol_impl.py In this case, Sobol number generator won't work, but you can use other types of random numbers (e.g., Halton numbers or pseudorandom numbers). |
All should be working now with TF 2.0 |
When we specify the SDE with dimension greater than one and simulate under Euler Scheme, we will have the following errors.
~/anaconda/envs/py36dev/lib/python3.6/site-packages/tf_quant_finance/models/ito_process.py in step_fn(i, written_count, current_state, result)
332 dw = random.mv_normal_sample(
333 (num_samples,), mean=wiener_mean, random_type=random_type,
--> 334 seed=seed)
335 dw = dw * sqrt_dt[i]
336 dt_inc = dt[i] * self.drift_fn()(current_time, current_state) # pylint: disable=not-callable
~/anaconda/envs/py36dev/lib/python3.6/site-packages/tf_quant_finance/math/random_ops/multivariate_normal.py in multivariate_normal(sample_shape, mean, covariance_matrix, scale_matrix, random_type, validate_args, seed, dtype, name, **kwargs)
170 name,
171 default_name='multivariate_normal',
--> 172 values=[sample_shape, mean, covariance_matrix, scale_matrix]):
173 if mean is not None:
174 mean = tf.convert_to_tensor(mean, dtype=dtype, name='mean')
TypeError: init() got an unexpected keyword argument 'default_name'
I'm using Tensorflow 2.0
The text was updated successfully, but these errors were encountered: