Examples
This page collects examples included in the different modules of the VAE project.
Models
VAE.models.example_VAE
example_VAE()
Example of a VAE model.
This function demonstrates how to build a VAE model using the method :func:VAE.models.VAE
.
Source code in VAE/models.py
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 |
|
VAE.models.example_VAEp
example_VAEp()
Example of a VAEp model.
This function demonstrates how to build a VAEp model using the method :func:VAE.models.VAEp
.
Source code in VAE/models.py
1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
|
Layers
VAE.layers.example_Film
example_Film()
Example of Film layer.
Source code in VAE/layers.py
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
|
VAE.layers.example_GumbelSoftmax
example_GumbelSoftmax()
Example of GumbelSoftmax layer.
Source code in VAE/layers.py
779 780 781 782 783 784 785 786 787 |
|
VAE.layers.example_RandomSampling
example_RandomSampling()
Example of RandomSampling layer.
Source code in VAE/layers.py
790 791 792 793 794 795 796 797 798 799 800 |
|
Losses
VAE.losses.example_total_correlation_losses
example_total_correlation_losses()
Example of total correlation loss functions.
Source code in VAE/losses.py
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
|
VAE.losses.example_similarity_losses
example_similarity_losses()
Example of similarity loss functions.
Source code in VAE/losses.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
|
Generators
VAE.generators.example_FitGenerator
example_FitGenerator()
Example of :class:FitGenerator
.
This example shows how to use the :class:FitGenerator
class.
Source code in VAE/generators.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 |
|
FileIO
VAE.utils.fileio.example_read_climexp_raw_data_multi
example_read_climexp_raw_data_multi()
Example of how to use the function read_climexp_raw_data_multi
.
The function reads multiple files of raw data from the example_data/
folder.
example_data/icmip5_tos_Omon_one_rcp45_pc01.txt
example_data/icmip5_tos_Omon_one_rcp45_pc02.txt
Source code in VAE/utils/fileio.py
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
|
VAE.utils.fileio.example1_read_netcdf
example1_read_netcdf()
Example of how to use the function read_netcdf
.
This function reads EOFs in a netCDF file from the Climate explorer from the example_data/
folder:
example_data/eofs_icmip5_tos_Omon_one_rcp45.nc
Source code in VAE/utils/fileio.py
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 |
|
VAE.utils.fileio.example2_read_netcdf
example2_read_netcdf()
Example of how to use the function read_netcdf
.
This function reads EOFs in a netCDF file from the output of the climate data operators (CDO). The file is from the
example_data/
folder:
example_data/eofs_anom_gpcc_v2020_1dgr.nc
:material-github: For the calculation of the EOFs and PCs with CDO see the CDO scripts.
Source code in VAE/utils/fileio.py
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 |
|
VAE.utils.fileio.example3_read_netcdf
example3_read_netcdf()
Example of how to use the function read_netcdf
.
This function reads PCs in a netCDF file from the output of the climate data operators (CDO). The file is from the
example_data/
folder:
example_data/pcs_anom_gpcc_v2020_1dgr.nc
:material-github: For the calculation of the EOFs and PCs with CDO see the CDO scripts.
Source code in VAE/utils/fileio.py
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
|
VAE.utils.fileio.example_read_netcdf_multi
example_read_netcdf_multi(filename)
Example of how to use the function read_netcdf_multi
.
This function reads PCs in multiple netCDF files from the output of the climate data operators (CDO). The files are
from the example_data/
folder:
example_data/pcs_anom_pr_*.nc
:material-github: For the calculation of the EOFs and PCs with CDO see the CDO scripts.
Source code in VAE/utils/fileio.py
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 |
|