Plots a length histogram.
(element, path)
| 810 | |
| 811 | |
| 812 | def plot_histogram(element, path): |
| 813 | """Plots a length histogram.""" |
| 814 | _, ax = plt.subplots(nrows=2, ncols=1) |
| 815 | bins = np.r_[np.linspace(0, 8192, num=512), np.inf] |
| 816 | ax[0].hist(element["inputs"], bins=bins, density=True, cumulative=True) |
| 817 | ax[0].set_xlim([0, 8192]) |
| 818 | ax[0].set_title("Inputs") |
| 819 | ax[1].hist(element["targets"], bins=bins, density=True, cumulative=True) |
| 820 | ax[1].set_xlim([0, 8192]) |
| 821 | ax[1].set_title("Targets") |
| 822 | |
| 823 | plt.tight_layout() |
| 824 | |
| 825 | with tf.io.gfile.GFile(path, "wb") as f: |
| 826 | plt.savefig(f, format="png", dpi=300) |
| 827 | |
| 828 | |
| 829 | def to_tfrecords_pipeline( |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…