@@ -21,7 +21,7 @@ description: Indexed entropy model for continuous random variables.
21
21
22
22
<table class =" tfo-notebook-buttons tfo-api nocontent " align =" left " >
23
23
<td >
24
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L30-L408 " >
24
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L30-L420 " >
25
25
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
26
26
View source on GitHub
27
27
</a >
@@ -36,7 +36,8 @@ Indexed entropy model for continuous random variables.
36
36
<code >tfc.ContinuousIndexedEntropyModel(
37
37
prior_fn, index_ranges, parameter_fns, coding_rank, channel_axis=-1,
38
38
compression=False, stateless=False, expected_grads=False, tail_mass=(2 ** -8),
39
- range_coder_precision=12, dtype=tf.float32, laplace_tail_mass=0
39
+ range_coder_precision=12, bottleneck_dtype=None, prior_dtype=tf.float32,
40
+ laplace_tail_mass=0
40
41
)
41
42
</code ></pre >
42
43
@@ -247,11 +248,19 @@ Integer. Precision passed to the range coding op.
247
248
</td >
248
249
</tr ><tr >
249
250
<td >
250
- ` dtype `
251
+ ` bottleneck_dtype `
251
252
</td >
252
253
<td >
253
- ` tf.dtypes.DType ` . Data type of this entropy model (i.e. dtype of
254
- prior, decompressed values).
254
+ ` tf.dtypes.DType ` . Data type of bottleneck tensor.
255
+ Defaults to ` tf.keras.mixed_precision.global_policy().compute_dtype ` .
256
+ </td >
257
+ </tr ><tr >
258
+ <td >
259
+ ` prior_dtype `
260
+ </td >
261
+ <td >
262
+ ` tf.dtypes.DType ` . Data type of prior and probability
263
+ computations. Defaults to ` tf.float32 ` .
255
264
</td >
256
265
</tr ><tr >
257
266
<td >
@@ -275,6 +284,13 @@ laplace mixture for training stability. (experimental)
275
284
276
285
<tr >
277
286
<td >
287
+ ` bottleneck_dtype `
288
+ </td >
289
+ <td >
290
+ Data type of the bottleneck tensor.
291
+ </td >
292
+ </tr ><tr >
293
+ <td >
278
294
` cdf `
279
295
</td >
280
296
<td >
@@ -310,13 +326,6 @@ Whether this entropy model is prepared for compression.
310
326
</td >
311
327
</tr ><tr >
312
328
<td >
313
- ` dtype `
314
- </td >
315
- <td >
316
- Data type of this entropy model.
317
- </td >
318
- </tr ><tr >
319
- <td >
320
329
` expected_grads `
321
330
</td >
322
331
<td >
@@ -380,6 +389,13 @@ Prior distribution, used for deriving range coding tables.
380
389
</td >
381
390
</tr ><tr >
382
391
<td >
392
+ ` prior_dtype `
393
+ </td >
394
+ <td >
395
+ Data type of ` prior ` .
396
+ </td >
397
+ </tr ><tr >
398
+ <td >
383
399
` prior_fn `
384
400
</td >
385
401
<td >
@@ -461,7 +477,7 @@ of calling this method if you don't expect the return value to change.
461
477
462
478
<h3 id =" compress " ><code >compress</code ></h3 >
463
479
464
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L338-L369 " >View source</a >
480
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L349-L381 " >View source</a >
465
481
466
482
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
467
483
<code >compress(
@@ -523,7 +539,7 @@ coding unit.
523
539
524
540
<h3 id =" decompress " ><code >decompress</code ></h3 >
525
541
526
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L371-L397 " >View source</a >
542
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L383-L409 " >View source</a >
527
543
528
544
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
529
545
<code >decompress(
@@ -577,7 +593,7 @@ dimension).
577
593
578
594
<h3 id =" from_config " ><code >from_config</code ></h3 >
579
595
580
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L404-L408 " >View source</a >
596
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L416-L420 " >View source</a >
581
597
582
598
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
583
599
<code >@classmethod</code >
@@ -591,7 +607,7 @@ Instantiates an entropy model from a configuration dictionary.
591
607
592
608
<h3 id =" get_config " ><code >get_config</code ></h3 >
593
609
594
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L399-L402 " >View source</a >
610
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L411-L414 " >View source</a >
595
611
596
612
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
597
613
<code >get_config()
@@ -602,7 +618,7 @@ Returns the configuration of the entropy model.
602
618
603
619
<h3 id =" get_weights " ><code >get_weights</code ></h3 >
604
620
605
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L339- L340 " >View source</a >
621
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L340-L341 " >View source</a >
606
622
607
623
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
608
624
<code >get_weights()
@@ -613,7 +629,7 @@ Returns the configuration of the entropy model.
613
629
614
630
<h3 id =" quantize " ><code >quantize</code ></h3 >
615
631
616
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L320-L336 " >View source</a >
632
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L330-L347 " >View source</a >
617
633
618
634
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
619
635
<code >quantize(
@@ -662,7 +678,7 @@ A `tf.Tensor` containing the quantized values.
662
678
663
679
<h3 id =" set_weights " ><code >set_weights</code ></h3 >
664
680
665
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L342-L347 " >View source</a >
681
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L343-L348 " >View source</a >
666
682
667
683
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
668
684
<code >set_weights(
@@ -738,7 +754,7 @@ The original method wrapped such that it enters the module's name scope.
738
754
739
755
<h3 id =" __call__ " ><code >__call__</code ></h3 >
740
756
741
- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L277-L318 " >View source</a >
757
+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L286-L328 " >View source</a >
742
758
743
759
<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
744
760
<code >__call__(
0 commit comments