pypospack.pyposmat.engines package¶
Submodules¶
pypospack.pyposmat.engines.base_sampler module¶
This module contains the pyposmat engine for parameterization
-
class
pypospack.pyposmat.engines.base_sampler.
PyposmatBaseSampler
(config_fn='pyposmat.config.in', results_fn='pyposmat.results.out', bad_parameters_fn='pyposmat.bad_parameters.out', data_in_fn=None, o_config=None, o_log=None, mpi_rank=None, mpi_size=None, base_directory=None)[source]¶ Bases:
pypospack.pyposmat.engines.engine.PyposmatEngine
Base Sampling Engine to build other engines upon
- Parameters
config_fn (str) – filename of the configuration file
data_out_fn (str) – filename where to output the the simulation results
-
config_fn
¶ filename of the configuration file
- Type
str
-
data_in_fn
¶ filename where to get previous simulation results
- Type
str
-
data_out_fn
¶ filename where to output the current simulation results
- Type
str
-
parameters_fn
¶ filename where to output current simulation results
- Type
str
-
data_in(
obj:PyposmatDataFile): object for reading in a data file
-
data_out(
obj:PyposmatDataFile): object for write out a data file
-
configure_pyposmat_datafile_in
(filename=None)[source]¶ configures the data_in attribute
- Parameters
filename (str) – path of the input file to be used
-
configure_pyposmat_datafile_out
(filename)[source]¶ configures the data_out attribute
- Parameters
filename (str) – path of the output file to be used
-
constrained_parameter_names
¶
-
error_names
¶
-
free_parameter_names
¶
-
generate_free_parameters
()[source]¶ stub implementation which needs to be overrided by the inheriting class
-
log
(str_msg)[source]¶ log message to log file
- Parameters
str_msg (str,list) –
- Raises
TypeError – If type(str_msg) not either a :obj:str or a :obj:list of :obj:str
-
n_iterations
¶
-
parameter_constraints
¶
-
parameter_distribution_definition
¶
-
parameter_names
¶
-
qoi_names
¶
-
read_configuration_file
(filename=None)[source]¶ read the pyposmat configuration file
This method overrides the inherited method.
- Parameters
filename (str,optional) – path of the filename. If the filename is
not specified, then the method will run using the class attribute, config_fn
- Returns
Nothing returned
- Raises
TypeError –
pypospack.pyposmat.engines.cluster_engine module¶
This module implements tSNE and DBSCAN to sample from reduced partitions of the whole dataset
Author: Seaton Ullberg, 2018 w/ edits by EJR
-
class
pypospack.pyposmat.engines.cluster_engine.
PyposmatClusterSampler
(filename_in='pyposmat.config.in', filename_out='pyposmat.results.out', mpi_comm=None, mpi_rank=None, mpi_size=None, base_directory=None, o_logger=None)[source]¶ Bases:
pypospack.pyposmat.engines.engine.PyposmatEngine
-
configuration_fn
¶
-
data_fn
¶
-
pypospack.pyposmat.engines.engine module¶
-
class
pypospack.pyposmat.engines.engine.
PyposmatEngine
(filename_in='pypospack.config.in', filename_out='pypospack.results.out', base_directory=None, fullauto=False)[source]¶ Bases:
object
-
EAM_EOS_EMBEDDING_FUNCTIONS
= ['eam_embed_eos_rose']¶ class for evaluating a simulation
This class combines the two classes QoiManager, which manages classes used to manage the classes used in modelling and calculating material properties, and TaskManager, which manages classes used to manage the classes used in specific simulations.
- Parameters
filename_in (str) – path in
filename_out (str) – path out
base_directory (str) – This is the base directory from which the PyposmatEngine will create and run simulations. By default this is set to None, which means it will use the current working directory as the base directory.
fullauto (bool) –
-
pyposmat_filename_in
¶ path in
- Type
str
-
pyposmat_filename_out
¶ - Type
str
-
base_directory
¶ the base directory
- Type
str
-
rank_directory
¶ This reflect the MPI rank of the processsor that the PyposmatEngine is running on. If there is no MPI available, this is automatically set to rank0000.
- Type
str
-
configuration
¶ - Type
pypospack.pyposmat.PyposmatConfigurationFile
-
qoi_manager
¶ - Type
pypospack.qoi.QoiManager
-
task_mamanger
¶ - Type
pypospack.task.TaskManager
-
evaluate_parameter_set
(parameters)[source]¶ - Parameters
parameters (OrderedDict) – hashtable of parameter values with the key value defined by the configuration file or the PyposmatConfigurationFile object. Only the free parameter values need to be defined. Constrained parameter values will be automatically generated
- Returns
- hashtable of results with the key value being defined
by the the either configuration file or the PyposmatConfigurationFile object
- Return type
OrderedDict
- Exceptions:
LammpsSimulationError
-
potential
¶ (collections.OrderedDict)
-
structure_directory
¶
-
structures
¶ (collections.OrderedDict)
-
pypospack.pyposmat.engines.filesampler module¶
-
class
pypospack.pyposmat.engines.filesampler.
PyposmatFileSampler
(config_fn='pyposmat.config.in', data_in_fn='pyposmat.results.in', data_out_fn='pyposmat.results.out', mpi_rank=None, mpi_size=None, o_log=None, log_to_stdout=True, base_directory=None, fullauto=True)[source]¶ Bases:
pypospack.pyposmat.engines.engine.PyposmatEngine
samples from a datafile
- Parameters
config_fn (str) – path of the configuration file
data_in_fn (str) – path of the datafile to sample from
data_out_fn (str) – path of the datafile to write results to
mpi_rank (int) – the MPI rank of this process
mpi_rank – the MPI size of this process
log (PyposmatLogFile) – log object instance
-
configuration
¶ configuration file
-
datafile_in
¶ object instance of the datafile being read in
- Type
-
datafile_out
¶ object instance of the datafiel being written to
- Type
-
configure_logger
(o_log=None, log_to_stdout=True)[source]¶ Configurtion of the log object has different behavior based upon the type passed into the argument o_log. If o_log is PyposmatLogFile, that object will be accessed by reference. A string is assumed to be a filename location. By default the argument for o_log is None, which means logging will go to standard out by means of the print() function.
- Parameters
o_log (str,PyposmatLogFile,None) – default: None
-
error_names
¶
-
free_parameter_names
¶
-
log
(str_msg)[source]¶ log message
- Parameters
str_msg (str,list) – This is the message to log. If this argument is a string, then the string will bemessage to log
-
n_iterations
¶
-
normed_error_names
¶
-
parameter_constraints
¶
-
parameter_distribution_definition
¶
-
parameter_names
¶
-
qoi_names
¶
-
qoi_targets
¶
pypospack.pyposmat.engines.kde_sampler module¶
-
class
pypospack.pyposmat.engines.kde_sampler.
PyposmatKdeSampler
(config_fn='pyposmat.config.in', results_fn='pyposmat.results.out', bad_parameters_fn='pyposmat.bad_parameters.out', data_in_fn=None, o_config=None, o_log=None, mpi_rank=None, mpi_size=None, base_directory=None)[source]¶ Bases:
pypospack.pyposmat.engines.base_sampler.PyposmatBaseSampler
pypospack.pyposmat.engines.mc_sampler module¶
This module contains the pyposmat engine for parameterization
-
class
pypospack.pyposmat.engines.mc_sampler.
PyposmatMonteCarloSampler
(filename_in='pyposmat.config.in', filename_out='pyposmat.results.out', o_log=None, mpi_rank=None, mpi_size=None, base_directory=None)[source]¶ Bases:
pypospack.pyposmat.engines.engine.PyposmatEngine
-
configure_logger
(o_log=None)[source]¶ Configurtion of the log object has different behavior based upon the type passed into the argument o_log. If o_log is PyposmatLogFile, that object will be accessed by reference. A string is assumed to be a filename location. By default the argument for o_log is None, which means logging will go to standard out by means of the print() function.
- Parameters
o_log (str,PyposmatLogFile,None) – default: None
-
determine_kde_bandwidth
(X, kde_bw_type)[source]¶ determine kde bandwidth
- Parameters
X (np.ndarray) – array of data to determine the KDE bandwidth
kde_bw_type (str) – the method of estimating the optimal bandwidth
-
run_kde_sampling
(n_samples, filename_in, cluster_id=None, kde_bw_type='chiu1999')[source]¶ sample from a KDE distribution
- Parameters
n_samples (int) – the number of samples to draw from the KDE distribution
filename_in (str) – the path to the datafile from which the parameters will be drawn from
cluster_id (int) – if we need to use a specific cluster_id, we specify it here. otherwise, it will be drawn from all parameters contained within the set.
kde_bw_type (str) – the method of estimating the optimal bandwidth
-
pypospack.pyposmat.engines.mc_sampler_iterate module¶
- VERSION HISTORY:
2017 - EJR, original release 08/2018 = RSU, EJR, added cluster sampling functionality and logging
-
class
pypospack.pyposmat.engines.mc_sampler_iterate.
PyposmatIterativeSampler
(configuration_filename, is_restart=False, is_auto=False, log_fn=None, log_to_stdout=True)[source]¶ Bases:
object
Iterative Sampler which wraps multiple simulation algorithms.
This class wraps multiple simulation algorithms so that they can be run in an iterative manner. Since this class has so many configuration options, the attributes of this class is set by a YAML based configuration file. The class PyposmatConfigurationFile aids in the creation and reading of these options. These attributes are public and be set programmatically within a script.
Notes
config_fn = ‘data/pyposmat.config.in’
engine = PyposmatIterativeSampler(configuration_filename=config_fn) engine.read_configuration_file() engine.run_all()
- Parameters
configuration_filename (str) – the filename of the YAML configuration file
is_restart (bool,optional) – When set to True, this argument controls the restart behavior of this class. By default, is set to False
is_auto (bool,optional) – When set to True, this agument will automatically configure the class. By default this is set to False, mostly because this software is currently in development, and this necessary to to write integration testing
log_fn (str,optional) – This the filename path where to set logging, by default it is set as pyposmat.log contained in the configurable data directory
log_to_stdout (bool,optional) – When set to True, all log messages will be directed to standard out as well as the log file
-
mpi_comm
¶ - Type
MPI.Intracomm
-
mpi_rank
¶ - Type
int
-
mpi_size
¶ - Type
int
-
mpi_nprocs
¶ - Type
int
-
i_iteration
¶ - Type
int
-
n_iterations
¶ - Type
int
-
rv_seed
¶ - Type
int
-
rv_seeds
¶ - Type
np.ndarray
-
configuration_filename = configuration
- Type
filename
-
configuration
¶
-
mc_sampler
¶
-
root_directory
¶ - Type
str
-
data_directory
¶ - Type
str
-
is_restart
¶ - Type
bool
-
start_iteration=0
-
analyze_results
(i_iteration, data_fn=None, config_fn=None, kde_fn=None, analysis_fn=None)[source]¶ analyze the results of the simulation
this method analyzes the results of the simulation, and does post simulation tasks, such as filtering by qoi performance, pareto optimization, etc.
- Parameters
data_fn (str) – the path of the data file. By default this is set to none where the the file will be determine by i_iteration and internal attributes
config_fn (str) – the path of the data file. By default this is set to none where the the file will be determine by i_iteration and internal attributes
kde_fn (str) – the path of the data file. By default this is set to none where the the file will be determine by i_iteration and internal attributes
-
determine_number_of_samples_per_rank
(i_iteration, N_samples=None)[source]¶ determine the number of samples per rank
The total number of samples needs to be broken up between the ranks, but roughly divided the work evenly.
- Parameters
i_iteration (int) – which iteration we are in the simulation
N_samples (int,optional) – the total number of samples we are using for this iteration. If a number is provided, it will override the number of simulations specified in the configuration file.
- Returns
the number of samples for this rank
- Return type
(int)
-
determine_rv_seeds
(seed=None, i_iteration=None)[source]¶ set the random variable seed across simulations
- Parameters
seed (int,optional) – different ranks and iterations.
-
error_names
¶
-
initialize_data_directory
(data_directory=None)[source]¶ determine the absolute path of the data directory and create it
This method sets the data_directory attribute of the class and creates the data directory if the data directory already exists.
- Parameters
data_directory (str) – the path of the data directory, the path can be expressed in either a relative path, or an absolute path
- Returns
(str) the absolute path of the data directory
- Raises
OSError – if the directory is not able to be created
-
initialize_file_sampler
(config_fn, results_fn, i_iteration=0, mpi_rank=None, mpi_size=None, o_log=None)[source]¶ initialize the sampling object
This method initializes the mc_sampler attribute with a sampler.
Note
This breakout is part of a larger effort within PYPOSPACK, to have more object-oriented approach for parametric sampling. The goal eventually is to implement an instance of PyposmatBaseSampler, and allow users of this software library to be able to extend this software by simply extending the base class.
- Parameters
config_fn (str) – path to the configuration file
results_fn (str) – path to the results file
i_iteration (int,optional) – the iteration to sample the file from, by default this is set to zero.
mpi_rank (int,optional) – the MPI rank of executing this method
mpi_size (int,optional) – the size of the MPI execution group
o_log (PyposmatLogFile,str,optional) – the log file. If a string is passed, then the sampling class will initialize a separate log file with the string of path created. If a log file object is passed, then sampling object will use that instance of the object to log information. By defaut, it will pass the attribute, o_log.
-
initialize_logger
(log_fn=None, log_to_stdout=None)[source]¶ initialize log object
- Parameters
log_fn (str,optional) –
-
initialize_rank_directory
()[source]¶ create the rank directory
This method defines the rank directory as an absolute path and stores it in the attribute rank_directory. If a current directory exists there, then it is deleted with alll it’s contents and then recreated.
-
initialize_sampler
(config_fn, results_fn, mpi_rank=None, mpi_size=None, o_log=None)[source]¶ initialize the sampling object
This method initializes the mc_sampler attribute with a sampler.
Note
This breakout is part of a larger effort within PYPOSPACK, to have more object-oriented approach for parametric sampling. The goal eventually is to implement an instance of PyposmatBaseSampler, and allow users of this software library to be able to extend this software by simply extending the base class.
- Parameters
config_fn (str) – path to the configuration file
results_fn (str) – path to the results file
mpi_rank (int,optional) – the MPI rank of executing this method
mpi_size (int,optional) – the size of the MPI execution group
o_log (PyposmatLogFile,str,optional) – the log file. If a string is passed, then the sampling class will initialize a separate log file with the string of path created. If a log file object is passed, then sampling object will use that instance of the object to log information. By defaut, it will pass the attribute, o_log.
-
log_iteration_information
(i_iteration)[source]¶ log iteration information
- Parameters
i_iteration_id (int) – the iteration number
- Returns
(str) the log string
-
merge_data_files
(i_iteration, last_datafile_fn=None, new_datafile_fn=None)[source]¶ merge the pyposmat data files
- Parameters
i_iteration (int) – the current iteration which just finished
last_datafile_fn (str,optional) – the filename of the last dataset in the data directory.
new_datafile_fn (str,optional) – where to output the file results
-
merge_error_files
(i_iteration)[source]¶ merge the pyposmat data files
- Parameters
i_iteration (int) – the current iteration which just finished
last_datafile_fn (str,optional) – the filename of the last dataset in the data directory.
new_datafile_fn (str,optional) – where to output the file results
-
n_iterations
-
parameter_sampling_types
= ['parametric', 'kde', 'from_file', 'kde_w_clusters']¶
-
qoi_names
¶
-
run_file_sampling
(i_iteration)[source]¶ run file sampling
- Parameters
i_iteration (int) – the iteration which to sampling for
-
run_kde_sampling
(i_iteration)[source]¶ run kde sampling
- Parameters
i_iteration (int) – what iteration of the sampling is happening
-
run_parametric_sampling
(i_iteration)[source]¶ run parametric sampling
- Parameters
i_iteration (int) – what iteration of the sampling is happening
-
run_simulations
(i_iteration)[source]¶ run simulation for a single iteration
Each rank is given a different execution context so that the disk IO don’t conflict
-
structure_directory
¶
pypospack.pyposmat.engines.parametric_sampler module¶
-
class
pypospack.pyposmat.engines.parametric_sampler.
PyposmatParametricSampler
(config_fn='pyposmat.config.in', results_fn='pyposmat.results.out', bad_parameters_fn='pyposmat.bad_parameters.out', data_in_fn=None, o_config=None, o_log=None, mpi_rank=None, mpi_size=None, base_directory=None)[source]¶ Bases:
pypospack.pyposmat.engines.base_sampler.PyposmatBaseSampler


Holiday Gift Guide 2019: The Best Travel Gifts For Badass Feminists
by Lois Alter MarkWomen have had enough.They have found their voices and, as they travel the globe, they are proudly standing up for their rights.
These gifts will empower them as they make their way and, because women tend to take care of the world, many of them also give back to important causes with each purchase.
As Chimamanda Ngozi Adichie said, “We should all be feminists.” Sure, feminists experience delays and lost luggage and reclining passengers who end up in their lap, too; nevertheless, they persist.
It’s a spotted shirt, it’s a leopard print, it’s … RBG?! As subtle as the Notorious one herself, this great-looking shirt quietly makes a powerful statement. It’s soft and stretchy and super-comfy – would you expect anything else? – and it’s so empowering to surround yourself with little Ruth Bader Ginsbergs. Don’t like the snacks they’re offering in coach? Dissent! Price: $78
Joanna Taylor rescues fabric remnants and transforms them into meaningful personal talismans that make great traveling companions. Each one-of-a-kind cuff bracelet is stitched by hand, and provides strength and comfort every time you look at it. Because these conversation pieces are so soft and comfortable, you’ll want them for your every mood. To encourage you to use your voice, Taylor will customize the text so you can express yourself fully. Price: $48
Show her you appreciate her with this luxurious cashmere travel set from feminist favorite, Lingua Franca.
 It all comes in a hand-embroidered travel bag that lets her seatmates know not to mess around because she will ultimately win the armrest battle. Price: $425
Save them the trouble by carrying this stand-out tote that definitely sends a message.  In fact, it’s so practical (and charitable, with your purchase helping to support Planned Parenthood), it just may make you smile.
ModSock is all about girl power, and just knowing you are wearing some pretty inspiring women – Frida, Rosie, Michelle – on your feet will help you hold your head a little higher and get you through the toughest challenges. The ones with the curses are especially confidence-building and just may make the man-spreader next to you slink back into his own space. Price: From $8
Ask yourself what 86 year old Ruth Bader Ginsburg would do, and stay hydrated. This stainless steel vacuum insulated water bottle from the people who coordinated hundreds to plank like RBG on the steps of the Supreme Court holds 17 ounces and helps support Time’s Up Legal Defense Fund. You just may set your own precedent by carrying around this environmentally-friendly vessel. Price: $26
Feminists get stuff done, and they’re always multi-tasking, just like this great-looking toothbrush.
Made from bamboo, it’s lightweight and compostable, as is the cotton linen bag that keeps it protected during travel. The handcrafted handle has red bristles and a painted red bottom to prevent water from pooling and to signify that 10% of sales go towards protecting women’s rights and reproductive health. This should provide enough incentive to keep brushing. Price: $12
Given the right tools, women can fix anything. And the Swiss Champ is the right tool; in fact, it’s 33 of them in one.
Sure, it’s got tweezers and a nail file but it also has a wood saw, a screwdriver and a wire cutter. This beauty belong in every woman’s purse, checked bag or glove compartment. Price: $80
Made by artisans in Venezuela, this statement pouch holds your TSA-sized toiletries while helping to fight against hunger and child malnutrition. The vibrant color makes it easy to find in your carry-on after a red-eye flight so you can arrive fresh and ready to fight the patriarchy. Price: $30


Provides classes for parsing and interpreting cube scripts.
Package Specification
The Parser is very flexible. A Notation object describes the tokens and syntax
used by the Parser. The result of the parsing process is the parse tree. The
parse tree consists of Node objects. A Node in a parse tree can be applied to
a Cube object in order to alter the state of the Cube object.
A ScriptPlayer can be used to play a script represented as a parse tree.


{% extends 'base.html' %} {% load crispy_forms_tags %} {% block title %} Forgor your Password? {% endblock title %} {% block content %}
Enter your email address below, and we'll mail instructions for setting a new password.


Lorem Ipsum as their us default model text and it ipsum will uncover for many web site these in years therefore always free.
Lorem Ipsum as their us default model text and it ipsum will uncover for many web site these in years therefore always free.
Lorem Ipsum as their us default model text and it ipsum will uncover for many web site these in years therefore always free.
Lorem Ipsum as their us default model text and it ipsum will uncover for many web site these in years therefore always free.
Lorem Ipsum which looks reasonable generate orem Ipsum this always free from repetition injected humour non chara teristic words sum passages more recently with desktop publishing software like pageMaker including versions randomised in words which of Ipsum, you need to be sure there hidden in the middles. Sure there anything in the words embarrassing hidde nmiddle simply dummy text versions.
Lorem Ipsum which looks reasonable generate orem Ipsum this always free from repetition injected humour non chara teristic words sum passages more recently with desktop publishing software like pageMaker including versions randomised in words which of Ipsum, you need to be sure there hidden in the middles. Sure there anything in the words embarrassing hidde nmiddle simply dummy text versions.
Lorem Ipsum which looks reasonable generate orem Ipsum this always free from repetition injected humour non chara teristic words sum passages more recently with desktop publishing software like pageMaker including versions randomised in words which of Ipsum, you need to be sure there hidden in the middles. Sure there anything in the words embarrassing hidde nmiddle simply dummy text versions.


Static site uploads are currently capped at {{ maxFilesize }}MB. Please upload a .zip file with an index.html file in the root of the folder.


I did a couple of machine learning projects so far and there are some patterns in the projects which turned out to be good ideas. In this post, I would like to share those patterns with you.
Know your problem
For me, a machine learning project really starts when you have a well-defined problem, data, and a metric in which you want to measure your models goodness. Just like Tom Mitchell defined Machine Learning:
A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E.
EDA
Exploratory Data Analysis should be the very first step. Know what your data looks like. Which errors can be expected to be in the data? How is it distributed?
For CSV files, I wrote the Exploratory Data Analysis article. Usually, this starts with having a look at examples and making some graphs. EDA depends on what kind of data you have and which problem you want to solve. I will not go into detail in this post.
Project structure
.
├── artifacts
│ ├── train : Logfiles, trained models
│ └── test : Logfiles
├── datasets : Data loading scripts
├── experiments : Configuration files
├── models : Scripts defining how the model looks like
├── optimizers : Scripts defining the optimizeres
└── train : Script to run the training
The important part here is that you have an experiments/
folder which
contains configuration files. So your scripts should not contain any
hyperparameters. All hyperparameters, including the complete model, should be
set in the configuration.
Configuration files
An example from my masters thesis is cifar10_opt.yaml
:
dataset:
script_path: ../datasets/cifar10_keras.py
model:
script_path: ../models/optimized.py
optimizer:
script_path: ../optimizers/adam_keras.py
initial_lr: 0.0001
train:
script_path: ../train/train_keras.py
artifacts_path: ../artifacts/cifar10_opt/
batch_size: 64
epochs: 1000
data_augmentation:
samplewise_center: False
samplewise_std_normalization: False
rotation_range: 0
width_shift_range: 0.1
height_shift_range: 0.1
horizontal_flip: True
vertical_flip: False
zoom_range: 0
shear_range: 0
channel_shift_range: 0
featurewise_center: False
zca_whitening: False
evaluate:
batch_size: 1000
augmentation_factor: 32
data_augmentation:
samplewise_center: False
samplewise_std_normalization: False
rotation_range: 0
width_shift_range: 0.15
height_shift_range: 0.15
horizontal_flip: True
vertical_flip: False
zoom_range: 0
shear_range: 0
channel_shift_range: 0
featurewise_center: False
zca_whitening: False
I load it like this:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run an experiment."""
import logging
import sys
import os
import yaml
import imp
import pprint
logging.basicConfig(
format="%(asctime)s %(levelname)s %(message)s",
level=logging.DEBUG,
stream=sys.stdout,
)
def main(yaml_filepath):
"""Example."""
cfg = load_cfg(yaml_filepath)
# Print the configuration - just to make sure that you loaded what you
# wanted to load
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(cfg)
# Here is an example how you load modules of which you put the path in the
# configuration. Use this for configuring the model you use, for dataset
# loading, ...
dpath = cfg["dataset"]["script_path"]
sys.path.insert(1, os.path.dirname(dpath))
data = imp.load_source("data", cfg["dataset"]["script_path"])
def load_cfg(yaml_filepath):
"""
Load a YAML configuration file.
Parameters
----------
yaml_filepath : str
Returns
-------
cfg : dict
"""
# Read YAML experiment definition file
with open(yaml_filepath, "r") as stream:
cfg = yaml.load(stream)
cfg = make_paths_absolute(os.path.dirname(yaml_filepath), cfg)
return cfg
def make_paths_absolute(dir_, cfg):
"""
Make all values for keys ending with `_path` absolute to dir_.
Parameters
----------
dir_ : str
cfg : dict
Returns
-------
cfg : dict
"""
for key in cfg.keys():
if key.endswith("_path"):
cfg[key] = os.path.join(dir_, cfg[key])
cfg[key] = os.path.abspath(cfg[key])
if not os.path.isfile(cfg[key]):
logging.error("%s does not exist.", cfg[key])
if type(cfg[key]) is dict:
cfg[key] = make_paths_absolute(dir_, cfg[key])
return cfg
def get_parser():
"""Get parser object."""
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
parser = ArgumentParser(
description=__doc__, formatter_class=ArgumentDefaultsHelpFormatter
)
parser.add_argument(
"-f",
"--file",
dest="filename",
help="experiment definition file",
metavar="FILE",
required=True,
)
return parser
if __name__ == "__main__":
args = get_parser().parse_args()
main(args.filename)
Starting small
Most machine learning tasks have a lot of computation. I'm speaking of many hours for the "real" task you want to solve. You will not be able to do so directly. You will make bugs. Maybe simple typos, maybe logical bugs, ...
Create a small toy example where you know how the output should look like. Just to reduce the number of hours you waste by waiting for the script to finish / break.
Logging to files
Even if your script is working, you can make other mistakes:
- You close the terminal accidentially.
- Your computer freezes.
- Your you is cancelled from the cluster by the admin, just a couple of minutes before it would finish.
- Your model at some point diverges.
For this reason, you should make sure that you log results to a file when you
have really long running scripts. Store those files in the artifacts/
directory.
Create a Trivial Solution
Most machine learning projects have trivial, simple and advanced solutions. For example, instead of having a machine learning based approach you can usually craft algorithms the traditional way. You should know how well those trivial solutions are, because:
- Baseline: They give you a baseline. A score with which you start and from which you can evaluate if your more complex approaches are worth it.
- Little effort: They are usually comparatively fast to implement. If you see that the trivial solution is already very good, you might be able to stop faster.
- Robustness: They are robust against error in the data. The trivial ones because they don't use the data, the simple ones because they are usually to restricted to overfit.
Here are some examples:
| Problem | Trivial | Simple | Advanced |
|---|---|---|---|
| Classification | Rules, Predict the most common class | Decision Tree | Neural Networks, SVMs, Gradient Boosting |
| Regression | Rules, Predict the average | Linear Regression | Neural Networks, Gaussian Mixture Models, ... |
| Clustering | Rules | k-Means | DBSCAN, OPTICS, SOMs |
| Recommendations | Rules | RBMs, ... | |
| RL | Rules | DQN, DDQN, ... (see post) |
Evaluation
Make sure that you have as few scoring numbers as possible. Sequences / example output is not so easy to compare. You should be able to tell if you improved. Ideally, it would be a single normalized score which also has a meaning and a pre-defined threshold, e.g.
- Accuracy: Is in [0, 1] and you can probably say in advance how high you have to get to be useful / when you can consider improvements marginal.
- Precision, Recall, MSE
- Cross-Entropy
- ...
Make it reproducible
Set seeds for all random number generators. And log on which hardware / with which software version you executed your stuff.
The reason for this is simply that you can proof you actually got the results you have. Or at least point to a reason why you can't get the results again.


{% extends 'base.html' %} {% load staticfiles %} {% load crispy_forms_tags %} {% block title %}Home{% endblock %} {% block address %} {% endblock %} {% block content %}
It is a phrase used to describe the practice of seeking resources outside of an organizational structure for part of an IT (Information Technology) function.
It is a phrase used to describe the practice of seeking resources outside of an organizational structure for part of an IT (Information Technology) function.


A few weeks ago the US Treasury Bond yield curve inverted. Yesterday I saw this visualization on Twitter recently that really illustrated the change well with historical context.
A positively sloping yield curve - or one where the long term rates are higher than short term - is correlated with a stronger economy. When companies are doing well, the yields on bonds (corresponding to debt issued to a company) are increased. When the opposite is true - when short term bonds pay the same yield, or higher yield than long term bonds - it is often correlated with a recession. Put another way - if you’re giving someone money for 10 years to invest, and they say they can’t make you any more than you’d get in 2 years - they probably believe something is wrong.
From Learning Markets:
A flat yield tells us that investors believe the Federal Reserve is going to be cutting interest rates. Typically, the Federal Reserve only has to cut interest rates when the economy is contracting and the Fed is trying to stimulate growth. Therefore, a flat yield curve is often a sign of an economic slowdown.
This is a topic I’m learning a bit more about, and writing about it has helped me develop my understanding. Some of the resources I’ve found helpful are the Investopedia, Learning Markets and ofcourse, Wikipedia.


public class Camera extends java.lang.Object implements Savable, java.lang.Cloneable
Camera
is a standalone, purely mathematical class for doing
camera-related computations.
Given input data such as location, orientation (direction, left, up), and viewport settings, it can compute data necessary to render objects with the graphics library. Two matrices are generated, the view matrix transforms objects from world space into eye space, while the projection matrix transforms objects from eye space into clip space.
Another purpose of the camera class is to do frustum culling operations, defined by six planes which define a 3D frustum shape, it is possible to test if an object bounded by a mathematically defined volume is inside the camera frustum, and thus to avoid rendering objects that are outside the frustum
| Modifier and Type | Class and Description |
|---|---|
static class |
Camera.FrustumIntersect
The
FrustumIntersect enum is returned as a result
of a culling check operation,
see contains(com.jme3.bounding.BoundingVolume) |
| Modifier and Type | Field and Description |
|---|---|
protected float[] |
coeffBottom |
protected float[] |
coeffLeft |
protected float[] |
coeffRight |
protected float[] |
coeffTop |
protected float |
frustumBottom
Distance from camera to bottom frustum plane.
|
protected float |
frustumFar
Distance from camera to far frustum plane.
|
protected float |
frustumLeft
Distance from camera to left frustum plane.
|
protected float |
frustumNear
Distance from camera to near frustum plane.
|
protected float |
frustumRight
Distance from camera to right frustum plane.
|
protected float |
frustumTop
Distance from camera to top frustum plane.
|
protected int |
height |
protected Vector3f |
location
Camera's location
|
protected java.lang.String |
name
The camera's name.
|
protected Matrix4f |
projectionMatrix |
protected Matrix4f |
projectionMatrixOverride |
protected Quaternion |
rotation
The orientation of the camera.
|
protected Matrix4f |
viewMatrix |
protected float |
viewPortBottom
Percent value on display where vertical viewing begins for this camera.
|
protected boolean |
viewportChanged |
protected float |
viewPortLeft
Percent value on display where horizontal viewing starts for this camera.
|
protected float |
viewPortRight
Percent value on display where horizontal viewing ends for this camera.
|
protected float |
viewPortTop
Percent value on display where vertical viewing ends for this camera.
|
protected Matrix4f |
viewProjectionMatrix |
protected int |
width |
protected Plane[] |
worldPlane
Array holding the planes that this camera will check for culling.
|
| Constructor and Description |
|---|
Camera()
Serialization only.
|
Camera(int width,
int height)
Constructor instantiates a new
Camera object. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearViewportChanged()
Clears the viewport changed flag once it has been updated inside
the renderer.
|
Camera |
clone() |
Camera.FrustumIntersect |
contains(BoundingVolume bound)
contains tests a bounding volume against the planes of the
camera's frustum. |
boolean |
containsGui(BoundingVolume bound)
containsGui tests a bounding volume against the ortho
bounding box of the camera. |
void |
copyFrom(Camera cam)
This method copies the settings of the given camera.
|
float |
distanceToNearPlane(Vector3f pos)
Returns the pseudo distance from the given position to the near
plane of the camera.
|
Vector3f |
getDirection()
getDirection retrieves the direction vector the camera is
facing. |
Vector3f |
getDirection(Vector3f store)
getDirection retrieves the direction vector the camera is
facing. |
float |
getFrustumBottom()
getFrustumBottom returns the value of the bottom frustum
plane. |
float |
getFrustumFar()
getFrustumFar gets the value of the far frustum plane. |
float |
getFrustumLeft()
getFrustumLeft gets the value of the left frustum plane. |
float |
getFrustumNear()
getFrustumNear gets the value of the near frustum plane. |
float |
getFrustumRight()
getFrustumRight gets the value of the right frustum plane. |
float |
getFrustumTop()
getFrustumTop gets the value of the top frustum plane. |
int |
getHeight() |
Vector3f |
getLeft()
getLeft retrieves the left axis of the camera. |
Vector3f |
getLeft(Vector3f store)
getLeft retrieves the left axis of the camera. |
Vector3f |
getLocation()
getLocation retrieves the location vector of the camera. |
java.lang.String |
getName()
This method returns the cameras name.
|
int |
getPlaneState()
getPlaneState returns the state of the frustum planes. |
Matrix4f |
getProjectionMatrix() |
Quaternion |
getRotation()
getRotation retrieves the rotation quaternion of the camera. |
Vector3f |
getScreenCoordinates(Vector3f worldPos)
Converts the given position from world space to screen space.
|
Vector3f |
getScreenCoordinates(Vector3f worldPosition,
Vector3f store)
Converts the given position from world space to screen space.
|
Vector3f |
getUp()
getUp retrieves the up axis of the camera. |
Vector3f |
getUp(Vector3f store)
getUp retrieves the up axis of the camera. |
Matrix4f |
getViewMatrix() |
float |
getViewPortBottom()
getViewPortBottom gets the bottom boundary of the viewport |
float |
getViewPortLeft()
getViewPortLeft gets the left boundary of the viewport |
float |
getViewPortRight()
getViewPortRight gets the right boundary of the viewport |
float |
getViewPortTop()
getViewPortTop gets the top boundary of the viewport |
Matrix4f |
getViewProjectionMatrix() |
float |
getViewToProjectionZ(float viewZPos)
Computes the z value in projection space from the z value in view space
Note that the returned value is going non linearly from 0 to 1.
|
int |
getWidth() |
Vector3f |
getWorldCoordinates(Vector2f screenPos,
float projectionZPos)
Computes a position in World space given a screen position in screen space (0,0 to width, height)
and a z position in projection space ( 0 to 1 non linear).
|
Vector3f |
getWorldCoordinates(Vector2f screenPosition,
float projectionZPos,
Vector3f store) |
Plane |
getWorldPlane(int planeId) |
boolean |
isParallelProjection() |
boolean |
isViewportChanged() |
void |
lookAt(Vector3f pos,
Vector3f worldUpVector)
lookAt is a convenience method for auto-setting the frame
based on a world position the user desires the camera to look at. |
void |
lookAtDirection(Vector3f direction,
Vector3f up)
lookAtDirection sets the direction the camera is facing
given a direction and an up vector. |
void |
normalize()
normalize normalizes the camera vectors.
|
void |
onFrameChange()
onFrameChange updates the view frame of the camera. |
void |
onFrustumChange()
onFrustumChange updates the frustum to reflect any changes
made to the planes. |
void |
onViewPortChange()
Called when the viewport has been changed.
|
void |
read(JmeImporter e) |
void |
resize(int width,
int height,
boolean fixAspect)
Resizes this camera's view with the given width and height.
|
void |
setAxes(Quaternion axes)
setAxes uses a rotational matrix to set the axes of the
camera. |
void |
setAxes(Vector3f left,
Vector3f up,
Vector3f direction)
setAxes sets the axes (left, up and direction) for this
camera. |
void |
setClipPlane(Plane clipPlane)
Sets a clipPlane for this camera.
|
void |
setClipPlane(Plane clipPlane,
Plane.Side side)
Sets a clipPlane for this camera.
|
void |
setFrame(Vector3f location,
Quaternion axes)
setFrame sets the orientation and location of the camera. |
void |
setFrame(Vector3f location,
Vector3f left,
Vector3f up,
Vector3f direction)
setFrame sets the orientation and location of the camera. |
void |
setFrustum(float near,
float far,
float left,
float right,
float top,
float bottom)
setFrustum sets the frustum of this camera object. |
void |
setFrustumBottom(float frustumBottom)
setFrustumBottom sets the value of the bottom frustum
plane. |
void |
setFrustumFar(float frustumFar)
setFrustumFar sets the value of the far frustum plane. |
void |
setFrustumLeft(float frustumLeft)
setFrustumLeft sets the value of the left frustum plane. |
void |
setFrustumNear(float frustumNear)
setFrustumNear sets the value of the near frustum plane. |
void |
setFrustumPerspective(float fovY,
float aspect,
float near,
float far)
setFrustumPerspective defines the frustum for the camera. |
void |
setFrustumRight(float frustumRight)
setFrustumRight sets the value of the right frustum plane. |
void |
setFrustumTop(float frustumTop)
setFrustumTop sets the value of the top frustum plane. |
void |
setLocation(Vector3f location)
setLocation sets the position of the camera. |
void |
setName(java.lang.String name)
This method sets the cameras name.
|
void |
setParallelProjection(boolean value)
Enable/disable parallel projection.
|
void |
setPlaneState(int planeState)
setPlaneState sets the state to keep track of tested
planes for culling. |
void |
setProjectionMatrix(Matrix4f projMatrix)
Overrides the projection matrix used by the camera.
|
void |
setRotation(Quaternion rotation)
setRotation sets the orientation of this camera. |
void |
setViewPort(float left,
float right,
float bottom,
float top)
setViewPort sets the boundaries of the viewport |
void |
setViewPortBottom(float bottom)
setViewPortBottom sets the bottom boundary of the viewport |
void |
setViewPortLeft(float left)
setViewPortLeft sets the left boundary of the viewport |
void |
setViewPortRight(float right)
setViewPortRight sets the right boundary of the viewport |
void |
setViewPortTop(float top)
setViewPortTop sets the top boundary of the viewport |
java.lang.String |
toString() |
void |
update()
update updates the camera parameters by calling
onFrustumChange ,onViewPortChange and
onFrameChange . |
void |
updateViewProjection()
Updates the view projection matrix.
|
void |
write(JmeExporter e) |
protected Vector3f location
protected Quaternion rotation
protected float frustumNear
protected float frustumFar
protected float frustumLeft
protected float frustumRight
protected float frustumTop
protected float frustumBottom
protected float[] coeffLeft
protected float[] coeffRight
protected float[] coeffBottom
protected float[] coeffTop
protected float viewPortLeft
protected float viewPortRight
protected float viewPortTop
protected float viewPortBottom
protected Plane[] worldPlane
protected int width
protected int height
protected boolean viewportChanged
protected Matrix4f projectionMatrixOverride
protected Matrix4f viewMatrix
protected Matrix4f projectionMatrix
protected Matrix4f viewProjectionMatrix
protected java.lang.String name
public Camera()
public Camera(int width, int height)
Camera
object. All
values of the camera are set to default.public Camera clone()
clone
in class java.lang.Object
public void copyFrom(Camera cam)
cam
- the camera we copy the settings frompublic void setName(java.lang.String name)
name
- the cameras namepublic java.lang.String getName()
public void setClipPlane(Plane clipPlane, Plane.Side side)
clipPlane
- the planeside
- the side the camera stands from the planepublic void setClipPlane(Plane clipPlane)
clipPlane
- the planepublic void resize(int width, int height, boolean fixAspect)
RenderManager
to notify the camera of
changes in the display dimensions.width
- the view widthheight
- the view heightfixAspect
- If true, the camera's aspect ratio will be recomputed.
Recomputing the aspect ratio requires changing the frustum values.public float getFrustumBottom()
getFrustumBottom
returns the value of the bottom frustum
plane.public void setFrustumBottom(float frustumBottom)
setFrustumBottom
sets the value of the bottom frustum
plane.frustumBottom
- the value of the bottom frustum plane.public float getFrustumFar()
getFrustumFar
gets the value of the far frustum plane.public void setFrustumFar(float frustumFar)
setFrustumFar
sets the value of the far frustum plane.frustumFar
- the value of the far frustum plane.public float getFrustumLeft()
getFrustumLeft
gets the value of the left frustum plane.public void setFrustumLeft(float frustumLeft)
setFrustumLeft
sets the value of the left frustum plane.frustumLeft
- the value of the left frustum plane.public float getFrustumNear()
getFrustumNear
gets the value of the near frustum plane.public void setFrustumNear(float frustumNear)
setFrustumNear
sets the value of the near frustum plane.frustumNear
- the value of the near frustum plane.public float getFrustumRight()
getFrustumRight
gets the value of the right frustum plane.public void setFrustumRight(float frustumRight)
setFrustumRight
sets the value of the right frustum plane.frustumRight
- the value of the right frustum plane.public float getFrustumTop()
getFrustumTop
gets the value of the top frustum plane.public void setFrustumTop(float frustumTop)
setFrustumTop
sets the value of the top frustum plane.frustumTop
- the value of the top frustum plane.public Vector3f getLocation()
getLocation
retrieves the location vector of the camera.getLocation()
public Quaternion getRotation()
getRotation
retrieves the rotation quaternion of the camera.public Vector3f getDirection()
getDirection
retrieves the direction vector the camera is
facing.getDirection()
public Vector3f getLeft()
getLeft
retrieves the left axis of the camera.getLeft()
public Vector3f getUp()
getUp
retrieves the up axis of the camera.getUp()
public Vector3f getDirection(Vector3f store)
getDirection
retrieves the direction vector the camera is
facing.getDirection()
public Vector3f getLeft(Vector3f store)
getLeft
retrieves the left axis of the camera.getLeft()
public Vector3f getUp(Vector3f store)
getUp
retrieves the up axis of the camera.getUp()
public void setLocation(Vector3f location)
setLocation
sets the position of the camera.location
- the position of the camera.public void setRotation(Quaternion rotation)
setRotation
sets the orientation of this camera. This will
be equivalent to setting each of the axes:
cam.setLeft(rotation.getRotationColumn(0));
cam.setUp(rotation.getRotationColumn(1));
cam.setDirection(rotation.getRotationColumn(2));
rotation
- the rotation of this camerapublic void lookAtDirection(Vector3f direction, Vector3f up)
lookAtDirection
sets the direction the camera is facing
given a direction and an up vector.direction
- the direction this camera is facing.public void setAxes(Vector3f left, Vector3f up, Vector3f direction)
setAxes
sets the axes (left, up and direction) for this
camera.left
- the left axis of the camera.up
- the up axis of the camera.direction
- the direction the camera is facing.setAxes(com.jme3.math.Quaternion)
public void setAxes(Quaternion axes)
setAxes
uses a rotational matrix to set the axes of the
camera.axes
- the matrix that defines the orientation of the camera.public void normalize()
public void setFrustum(float near, float far, float left, float right, float top, float bottom)
setFrustum
sets the frustum of this camera object.near
- the near plane.far
- the far plane.left
- the left plane.right
- the right plane.top
- the top plane.bottom
- the bottom plane.setFrustum(float, float, float, float,
float, float)
public void setFrustumPerspective(float fovY, float aspect, float near, float far)
setFrustumPerspective
defines the frustum for the camera. This
frustum is defined by a viewing angle, aspect ratio, and near/far planesfovY
- Frame of view angle along the Y in degrees.aspect
- Width:Height rationear
- Near view plane distancefar
- Far view plane distancepublic void setFrame(Vector3f location, Vector3f left, Vector3f up, Vector3f direction)
setFrame
sets the orientation and location of the camera.location
- the point position of the camera.left
- the left axis of the camera.up
- the up axis of the camera.direction
- the facing of the camera.setFrame(com.jme3.math.Vector3f,
com.jme3.math.Vector3f, com.jme3.math.Vector3f, com.jme3.math.Vector3f)
public void lookAt(Vector3f pos, Vector3f worldUpVector)
lookAt
is a convenience method for auto-setting the frame
based on a world position the user desires the camera to look at. It
repoints the camera towards the given position using the difference
between the position and the current camera location as a direction
vector and the worldUpVector to compute up and left camera vectors.pos
- where to look at in terms of world coordinatesworldUpVector
- a normalized vector indicating the up direction of the world.
(typically {0, 1, 0} in jME.)public void setFrame(Vector3f location, Quaternion axes)
setFrame
sets the orientation and location of the camera.location
- the point position of the camera.axes
- the orientation of the camera.public void update()
update
updates the camera parameters by calling
onFrustumChange
,onViewPortChange
and
onFrameChange
.update()
public int getPlaneState()
getPlaneState
returns the state of the frustum planes. So
checks can be made as to which frustum plane has been examined for
culling thus far.public void setPlaneState(int planeState)
setPlaneState
sets the state to keep track of tested
planes for culling.planeState
- the updated state.public float getViewPortLeft()
getViewPortLeft
gets the left boundary of the viewportpublic void setViewPortLeft(float left)
setViewPortLeft
sets the left boundary of the viewportleft
- the left boundary of the viewportpublic float getViewPortRight()
getViewPortRight
gets the right boundary of the viewportpublic void setViewPortRight(float right)
setViewPortRight
sets the right boundary of the viewportright
- the right boundary of the viewportpublic float getViewPortTop()
getViewPortTop
gets the top boundary of the viewportpublic void setViewPortTop(float top)
setViewPortTop
sets the top boundary of the viewporttop
- the top boundary of the viewportpublic float getViewPortBottom()
getViewPortBottom
gets the bottom boundary of the viewportpublic void setViewPortBottom(float bottom)
setViewPortBottom
sets the bottom boundary of the viewportbottom
- the bottom boundary of the viewportpublic void setViewPort(float left, float right, float bottom, float top)
setViewPort
sets the boundaries of the viewportleft
- the left boundary of the viewport (default: 0)right
- the right boundary of the viewport (default: 1)bottom
- the bottom boundary of the viewport (default: 0)top
- the top boundary of the viewport (default: 1)public float distanceToNearPlane(Vector3f pos)
pos
- The position to compute a distance to.public Camera.FrustumIntersect contains(BoundingVolume bound)
contains
tests a bounding volume against the planes of the
camera's frustum. The frustum's planes are set such that the normals all
face in towards the viewable scene. Therefore, if the bounding volume is
on the negative side of the plane is can be culled out.
NOTE: This method is used internally for culling, for public usage,
the plane state of the bounding volume must be saved and restored, e.g:
BoundingVolume bv;
Camera c;
int planeState = bv.getPlaneState();
bv.setPlaneState(0);
c.contains(bv);
bv.setPlaneState(plateState);
bound
- the bound to check for cullingFrustumIntersect
public Plane getWorldPlane(int planeId)
public boolean containsGui(BoundingVolume bound)
containsGui
tests a bounding volume against the ortho
bounding box of the camera. A bounding box spanning from
0, 0 to Width, Height. Constrained by the viewport settings on the
camera.bound
- the bound to check for cullingpublic Matrix4f getViewMatrix()
public void setProjectionMatrix(Matrix4f projMatrix)
projMatrix
- public Matrix4f getProjectionMatrix()
public void updateViewProjection()
public Matrix4f getViewProjectionMatrix()
public boolean isViewportChanged()
public void clearViewportChanged()
public void onViewPortChange()
public void onFrustumChange()
onFrustumChange
updates the frustum to reflect any changes
made to the planes. The new frustum values are kept in a temporary
location for use when calculating the new frame. The projection
matrix is updated to reflect the current values of the frustum.public void onFrameChange()
onFrameChange
updates the view frame of the camera.public boolean isParallelProjection()
setParallelProjection(boolean)
public void setParallelProjection(boolean value)
value
- true to set up this camera for parallel projection is enable, false to enter normal perspective modepublic float getViewToProjectionZ(float viewZPos)
viewZPos
- the z value in view space.public Vector3f getWorldCoordinates(Vector2f screenPos, float projectionZPos)
screenPos
- 2d coordinate in screen spaceprojectionZPos
- non linear z value in projection spacepublic Vector3f getWorldCoordinates(Vector2f screenPosition, float projectionZPos, Vector3f store)
public Vector3f getScreenCoordinates(Vector3f worldPos)
public Vector3f getScreenCoordinates(Vector3f worldPosition, Vector3f store)
getScreenCoordinates(Vector3f, Vector3f)
public int getWidth()
public int getHeight()
public java.lang.String toString()
toString
in class java.lang.Object
public void write(JmeExporter e) throws java.io.IOException
public void read(JmeImporter e) throws java.io.IOException


None
None
None
None
None
None
None
Close
HOME
GAMES
LDJAM
OTHER JAMS
BLOG (external)
Ludum Dare
List of games I've made for
Ludum Dare
, a 48h-72h game jam.
It's a Small World
Flipper
Burning Light
A Simple Tale
MK-F417XX3
Hero's Quest
Kitten
Cold Remembrance
The Nether
Persona
Two Options...
Space Rift
NoBility
Save the pricess
EVO-X
Hummy's Hunger
Loneliness


Welcome to my ePortfolio. This is where you will find my submissions for the ePortfolio project for CU Boulder's ASEN 1969 - Pathway to Space course.
You can find a PDF copy of my Resume here. If you're familiar with CLIs, check out my interactive resume.
Every problem has a solution, but finding it can be very challenging. This challenge is what drives me to work hard. In computer science and in space, there are so many problems that need solving. I hope to one day solve a revolutionary problem that no one has solved before.
To see a sample of my work, try the trivia game I created called "Orders of Magnitude".
For my community service, I helped out the Office of Information Technology here at CU Boulder on April 16th 2020. This session was held remotely, so I was at home in Massachusetts.
The activity was to answer questions on and provide feedback for various aspects of the new Buff Portal. They asked me questions like how I would attempt to find information, what I liked and disliked about various designs, and more. Overall, it went very well and I felt I was able to provide valuable feedback to their team. I chose this activity because my original community service idea was cancelled due to the Coronavirus. As for the impact I made, they will be using my suggestions and feedback to make the Buff Portal better, which will make finding and using school services much easier for future students. After the session, they told me they really valued my feedback and said it will be very useful for them.
After the activity, I felt great that I was able to help. As for connections, I now feel comfortable approaching the people I helped about jobs or internships in the future at CU’s IT department. While I do not currently have plans to do future community service, I always want to give back to the community and help out when I can. Opportunities like this assignment give me a head start to actually take these actions.


On January 31, 1991, I was born in Anchorage, Alaska. While I didn't know it at the time, this city would eventually become my base camp, serving as the starting point of many adventures.
Anchorage provides relatively easy access to multiple mountain ranges, but the Chugach Range serves as the city's closest outdoor playground. Within these mountains lie endless possibilities for backcountry skiers, hikers, climbers, and all who enjoy high places and fresh air.
The Moose's Tooth is my favorite restaurant because it serves the best pizza I've ever tasted, on planet Earth. They also brew an array of tasty beers.
View of Mt. Susitna from Flattop Mountain. This was taken at midnight during the summer.
In 2009, I moved to Socorro, NM. Socorro is a relatively sleepy desert town, roughly 80 miles south of Albuquerque, which is home to the thriving research university, New Mexico Tech. While attending this university, I discovered a wide array of delicious New Mexican flavors and also took some time to explore the surrounding desert.
This is Speck and Kiri, also known as the Franklin Street Patrol. They were my only roommates in Socorro who didn't pay rent, but they made up for it by looking tough and keeping watch over our residence.
Just outside of Socorro lies Box Canyon, a high-desert climbing destination featuring multiple styles of rock climbing: sport, traditional, and bouldering. Over the years, I probably spent just as much (or more) time climbing on Box's featured rhyolite as I spent in the classroom.
Box Canyon is home to a wealth of interesting climbing on rhyolite, tuff, and a little bit of sandstone too.
Both during and after my undergraduate, I spent a total of 3 years as a woodworker and/or ski bum in Taos, NM, the most enchanting place I've ever lived. Taos is well known for it's art scene, delicious food, and its wealth of natural beauty. With the plunging Rio Grande Gorge to the west and the towering Sangre de Cristo Mountains to the east. I've officially adopted Taos as my second home.
The Rio Grande Gorge, also known as the Taos Gorge, is well known for it's whitewater rafting and kayaking. However, for the less extreme among us, it is also home to several natural hot springs and excellent fishing.
The Sangre de Cristo Mountains, just east of Taos, made easy work of capturing most of my attention while I lived in northern New Mexico. While working and skiing at the local ski resort, Taos Ski Valley, I also made time to explore the less traveled areas of this region.
The Sangre de Cristo Mountains (Blood of Christ, in English) get their name from their typical red hue during sunset. In this photo, my friend Timmy walks the ridgeline of No Name Peak, eyeing perfect corn snow on the faces below.
After spending a healthy portion of my life exploring the southwest, I made the move to Corvallis, OR in 2016, to attend Oregon State University. I'm currently pursuing an M.S. degree in geotechnical engineering. When I'm not studying, I make time to explore the landscapes of Oregon and the greater Pacific Northwest. My current infatuation is the Cascade Mountain Range, but the trails around Corvallis offer plenty of fun without a 3 hour drive to the mountains.
This is the East Ridge Trail that leads to the summit of Mary's Peak, just outside of Corvallis. The mountain biking on Mary's Peak is difficult and exposed, but pays off hugely with nice views in the old groth forest.
The Cascades are a picturesque reminder of Oregon's volatile geologic history. About 200 million years ago, the Cascadia Subduction Zone formed, setting the stage for widespread volcanism in Oregon. This volcanism is the source of the Cascades, Oregon's renowned alpine playground, which features ample opportunities for hiking and backcountry skiing. Furthermore, Oregon's volcanic history is also responsible for the formation of Smith Rock, which is known to the worldwide climbing community as the birthplace of American sport climbing.
On this particular day near Santiam Pass, the snow was light and soft, due to particularly low temperatures during the last storm.
Despite it's reputation, sometimes the clouds will part in Oregon, and the resulting views make it feel quite vast. This captures Mt. Jefferson and The Sisters from Mt. Hood on a high-vis day.


Test purpose
- Create a resizable <canvas> element
- Create animated Oval and Phrase entitys to display in the canvas
- Create hook functions for the Phrase that will be invoked as the user enables and disables 'prefers-color-scheme' and 'prefers-reduced-motion' in the Browser's Inspector (Chrome)
- When 'prefers-color-scheme' is set to 'light' (default) the background should be light gray and the text dark green
- When 'prefers-color-scheme' is set to 'dark' the background should be dark gray and the text light green
- When 'prefers-reduced-motion' is set to 'reduced' the animation should stop; resizing the <canvas> element should NOT lead to distortions in the scene
- When 'prefers-reduced-motion' is unset the animation should start.
- When reloading the page, the scene should respect the last choices made in the browser's Inspector; in particular, if 'prefers-reduced-motion' has been set to 'reduced' the animation should play for five seconds, then stop automatically.
To toggle user preferences in Chrome: open the Inspector, press Ctrl/Cmd+Shift+P, type 'show rendering', click on the 'Show rendering' button.
This demo also includes HTML/CSS code for action to take when Javascript has been disabled on a page. Specifically, a background image will be displayed in the canvas (via CSS) unless a <script> tag in the HTML immediately following the <canvas> element runs - the code removes a class from the canvas element, which prevents the background image displaying. Test this by disabling Javascript in the browser and then reloading the demo.
Touch test: canvas should be resizable
Annotated code