tensorflow / tensorflow/probability

copy.deepcopy TransformedDistribution fails

Open
#1,609 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

import tensorflow_probability as tfp
import copy

tfd =tfp.distributions
tfb = tfp.bijectors
log_normal = tfd.TransformedDistribution(
distribution=tfd.Normal(loc=0., scale=1.),
bijector=tfb.Exp(),
name='LogNormalTransformedDistribution')

copy.deepcopy(log_normal)

The above raises TypeError: missing a required argument: 'distribution'.

Versions: tensorflow-probability==0.17.0, tensorflow==2.9.1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided TransformedDistribution deepcopy reproduction with the reported TensorFlow Probability and TensorFlow versions. Trace how TransformedDistribution is reconstructed during copy.deepcopy; done means the distribution can be deep-copied without the missing 'distribution' argument error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.