Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nflows only in nnanalysis #376

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions nmma/em/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@
from .utils import getFilteredMag, dataProcess
from .io import loadEvent

# import functions
from ..mlmodel.dataprocessing import gen_prepend_filler, gen_append_filler, pad_the_data
from ..mlmodel.resnet import ResNet
from ..mlmodel.embedding import SimilarityEmbedding
from ..mlmodel.normalizingflows import normflow_params
from ..mlmodel.inference import cast_as_bilby_result

# need to add these packages:
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader, TensorDataset, random_split
import torch.nn.functional as F
from nflows.nn.nets.resnet import ResidualNet
from nflows import transforms, distributions, flows
from nflows.distributions import StandardNormal
from nflows.flows import Flow
from nflows.transforms.autoregressive import MaskedAffineAutoregressiveTransform
from nflows.transforms import CompositeTransform, RandomPermutation
import nflows.utils as torchutils

matplotlib.use("agg")


Expand Down Expand Up @@ -1175,6 +1155,26 @@ def analysis(args):

def nnanalysis(args):

# import functions
from ..mlmodel.dataprocessing import gen_prepend_filler, gen_append_filler, pad_the_data
from ..mlmodel.resnet import ResNet
from ..mlmodel.embedding import SimilarityEmbedding
from ..mlmodel.normalizingflows import normflow_params
from ..mlmodel.inference import cast_as_bilby_result

# need to add these packages:
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader, TensorDataset, random_split
import torch.nn.functional as F
from nflows.nn.nets.resnet import ResidualNet
from nflows import transforms, distributions, flows
from nflows.distributions import StandardNormal
from nflows.flows import Flow
from nflows.transforms.autoregressive import MaskedAffineAutoregressiveTransform
from nflows.transforms import CompositeTransform, RandomPermutation
import nflows.utils as torchutils

# only continue if the Kasen model is selected
if args.model != "Ka2017":
print(
Expand Down
Loading