Skip to content

Commit

Permalink
Linear Examples (#27), closes #15
Browse files Browse the repository at this point in the history
Linear Examples
  • Loading branch information
mathematicalmichael authored Feb 23, 2021
2 parents 69e09c5 + ff28c72 commit c9001f1
Show file tree
Hide file tree
Showing 11 changed files with 456 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/mud_examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound
from pkg_resources import DistributionNotFound, get_distribution

try:
# Change here if project is renamed and does not equal the package name
Expand Down
10 changes: 5 additions & 5 deletions src/mud_examples/helpers.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# -*- coding: utf-8 -*-
#!/usr/env/bin python

import importlib
import argparse
import importlib
import logging
import os
import sys
import types

import numpy as np
from mud.funs import mud_sol, map_sol
from mud import __version__ as __mud_version__
from mud.funs import map_sol, mud_sol
from mud_examples import __version__

__author__ = "Mathematical Michael"
__copyright__ = "Mathematical Michael"
__license__ = "mit"
from mud_examples import __version__
from mud import __version__ as __mud_version__

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -277,7 +277,7 @@ def compare_linear_sols(transform, lam_ref, A, b,
if cov is None:
cov = np.eye(A.shape[1])

print("alpha = {}".format(alpha_list))
_logger.info("alpha = {}".format(alpha_list))
if isinstance(A, list): # svd approach returns list
dim_output = A[0].shape[0]
else:
Expand Down
3 changes: 2 additions & 1 deletion src/mud_examples/inv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
#!/usr/env/bin python

import argparse
import logging
import os
Expand Down Expand Up @@ -67,7 +68,7 @@ def main(args):
plt.rcParams['font.family'] = 'STIXGeneral'

N, mu, sigma = int(1E3), 0.25, 0.1 # number of samples from initial and observed mean (mu) and st. dev (sigma)
lam = np.random.uniform(low=-1,high=1,size=N) # sample set of the initial
lam = np.random.uniform(low=-1, high=1, size=N) # sample set of the initial

# Evaluate the QoI map on this initial sample set to form a predicted data set
qvals_predict = QoI(lam,5) # Evaluate lam^5 samples
Expand Down
Loading

0 comments on commit c9001f1

Please sign in to comment.