Skip to content

Commit

Permalink
Rework ARAD examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
tymorrow committed Nov 13, 2023
1 parent 7440a6f commit 13b37bb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 32 deletions.
39 changes: 39 additions & 0 deletions examples/modeling/arad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS,
# the U.S. Government retains certain rights in this software.
"""This example demonstrates how to use the PyRIID implementations of ARAD.
"""
import sys
import tensorflow as tf
from riid.models.neural_nets.arad import ARADv1TF, ARADv2TF

if len(sys.argv) == 2:
import matplotlib
matplotlib.use("Agg")


def show_summaries(model):
model_type = type(model).__name__
print(model_type)

model.encoder.summary()
model.decoder.summary()
model.autoencoder.summary()

# The following requires `graphviz` (system software) and `pydot` (Python package)
try:
tf.keras.utils.plot_model(
model.autoencoder,
f"{model_type}.png",
show_shapes=True,
rankdir="LR",
expand_nested=True,
)
except Exception:
pass


v1_model = ARADv1TF()
show_summaries(v1_model)
v2_model = ARADv2TF()
show_summaries(v2_model)
16 changes: 0 additions & 16 deletions examples/modeling/arad_v1.py

This file was deleted.

16 changes: 0 additions & 16 deletions examples/modeling/arad_v2.py

This file was deleted.

0 comments on commit 13b37bb

Please sign in to comment.