r"""Convert the first weight matrix of `.npz` file to `.pdf` by using `tl.visualize.W()`. Parameters ---------- path : str A folder path to `npz` files. regx : str Regx for the file name. Examples --------- Convert the first weight matrix of w1_pre...npz
(path=None, regx='w1pre_[0-9]+\.(npz)')
| 2510 | |
| 2511 | # Visualizing npz files |
| 2512 | def npz_to_W_pdf(path=None, regx='w1pre_[0-9]+\.(npz)'): |
| 2513 | r"""Convert the first weight matrix of `.npz` file to `.pdf` by using `tl.visualize.W()`. |
| 2514 | |
| 2515 | Parameters |
| 2516 | ---------- |
| 2517 | path : str |
| 2518 | A folder path to `npz` files. |
| 2519 | regx : str |
| 2520 | Regx for the file name. |
| 2521 | |
| 2522 | Examples |
| 2523 | --------- |
| 2524 | Convert the first weight matrix of w1_pre...npz file to w1_pre...pdf. |
| 2525 | |
| 2526 | >>> tl.files.npz_to_W_pdf(path='/Users/.../npz_file/', regx='w1pre_[0-9]+\.(npz)') |
| 2527 | |
| 2528 | """ |
| 2529 | file_list = load_file_list(path=path, regx=regx) |
| 2530 | for f in file_list: |
| 2531 | W = load_npz(path, f)[0] |
| 2532 | logging.info("%s --> %s" % (f, f.split('.')[0] + '.pdf')) |
| 2533 | visualize.draw_weights(W, second=10, saveable=True, name=f.split('.')[0], fig_idx=2012) |
| 2534 | |
| 2535 | |
| 2536 | def tf_variables_to_numpy(variables): |
nothing calls this directly
no test coverage detected
searching dependent graphs…