{% extends "material_layout.html" %} {% block body %}
Phenopolis is an open platform for harmonization and analysis of sequencing and phenotype data. The Phenopolis code is available at github. Funding is currently provided mainly by Retina UK, NIHR (UCL-Moorfields Eyes Hospital Biomedical Research Center) and in part by the UK Medical Research Council and the British Heart Foundation.
The data set provided on this website spans {{ total_patients }} sequenced individuals. All of the raw data from these projects have been reprocessed through the same pipeline, and jointly variant-called to increase consistency across projects.
Behind Phenopolis is a coalition of clinicians, geneticists, bioinformaticians and software engineers seeking to aggregate and harmonize sequencing and phenotype data using the Human Phenotype Ontology.
{% if version_number %}Version: {{ version_number }}{% endif %}
I started the development of Phenopolis.
I helped construct the website, and developed pubmedBatch, Phenogenon and several other analyses / visualisations in Phenopolis.
I developed gene burden tests and run the CNV pipeline (data to be integrated).
I helped integrate the SimReg method for discovering genotype-phenotype associations into phenopolis. SimReg evaluates the evidence of association between ontologically encoded phenotypes and rare alleles in given genes. Where there is strong evidence of association, SimReg also estimates a characteristic phenotype for the disease caused by pathogenic variants.
I worked on the front-end aspect of Phenopolis with a particular focus on improving the user interphase and user experience as well as the general performance of the web application.
I added the unit test and continuous integration framework and reviewed the security and usability of the website.
I have been sequencing patients who have a bone marrow failure syndrome that is clinically and genetically heterogeneous.
We have been trying to identify the genes responsible. Although we have had some success, a significant proportion remain uncharacterised, and we are interesting in novel analysis approaches using the Human Phenotype Ontology.
I entered and curated a large number of phenotypes encoded using the Human Phenotype Ontology
I am an MSc student of the Genetics of Human Disease program at University College London, doing my Masters project on Phenopolis.
I am a software developer developing a graph database for Phenopolis called Pheno4j. You can read more and view the source code here.
I am a geneticist (BSc in Genetics) and genetic counsellor (MSc in Genetic Counselling) who is helping to link the patients with their clinical and genetic data.
Rare disease diagnostic research labs and large initiatives such as Genomics England are generating growing amounts of next generation sequencing data and standardised clinical phenotypes encoded with the Human Phenotype Ontology (HPO).
There is a clear need for a free, easy and effective method of analysing and sharing this wealth of information between clinicians and researchers.
With this goal in mind, we have developed, Phenopolis, an open-source research and diagnosis tool. While there are already several commercial tools that provide filtering and prioritisation of genetic variants (e.g Congenica, Saphetor, Omicia) in patient, there are currently only two other open-source alternatives (Gemini and Seqr), and we are not aware of any tools which supports the type of HPO analysis our platform supports.
Our software unifies existing HPO analysis methods (Exomiser, SimReg) but also our own novel analysis and visualisation methods (PubmedScore, Phenogenon), through an easily extensible interface.
Phenopolis supports three visualisations of the data depending on the research question:
Our software is being actively used by UK universities, UCL, Queen Mary, Leeds, Oxford and Manchester, and has already been referenced in “The Human Phenotype Ontology 2017” update published in the Nucleic Acid Research 2016 (doi:10.1093/nar/gkw1039).
The team behind Phenopolis is a unique combination of software developers, PhD students, postdoctoral bioinformaticians, geneticists and clinicians, all dedicated to free software and data sharing, and has managed, in the space of a year with no project funding to make significant progress.
Seed funding would allow us to purchase the hardware to make our website reliable, add functionality and scale to provide a free service to anyone who wants to have their data analysed. After the funding period, Phenopolis will be connected to the Global Alliance for Genomics and Health network (which includes large patient database such as DECIPHER, PhenomeCentral) and could be used by initiatives such as Genomics England.
Our mission is to guarantee that anyone around the world will be able to use our platform for free to address important research and clinical questions . We think that Phenopolis is promoting an extremely important message of openness and data sharing to solve human disease.


flare.kindling¶
Submodules¶
flare.kindling.buffers module¶
-
class
flare.kindling.buffers.
PGBuffer
(obs_dim: Union[tuple, int], act_dim: Union[tuple, int], size: int, gamma: Optional[float] = 0.99, lam: Optional[float] = 0.95)¶ Bases:
object
A buffer for storing trajectories experienced by an agent interacting with the environment, and using Generalized Advantage Estimation (GAE-Lambda) for calculating the advantages of state-action pairs.
-
finish_path
(last_val: Union[int, float, numpy.array, None] = 0)¶ Call this at the end of a trajectory, or when one gets cut off by an epoch ending. This looks back in the buffer to where the trajectory started, and uses rewards and value estimates from the whole trajectory to compute advantage estimates with GAE-Lambda, as well as compute the rewards-to-go for each state, to use as the targets for the value function. The “last_val” argument should be 0 if the trajectory ended because the agent reached a terminal state (died), and otherwise should be V(s_T), the value function estimated for the last state. This allows us to bootstrap the reward-to-go calculation to account for timesteps beyond the arbitrary episode horizon (or epoch cutoff).
-
get
()¶ Call this at the end of an epoch to get all of the data from the buffer, with advantages appropriately normalized (shifted to have mean zero and std one). Also, resets some pointers in the buffer.
-
store
(obs: numpy.array, act: numpy.array, rew: Union[int, float, numpy.array], val: Union[int, float, numpy.array], logp: Union[float, numpy.array])¶ Append one timestep of agent-environment interaction to the buffer.
-
-
class
flare.kindling.buffers.
ReplayBuffer
(obs_dim: Union[tuple, int], act_dim: Union[tuple, int], size: int)¶ Bases:
flare.kindling.buffers.PGBuffer
A replay buffer for off-policy RL agents.
-
sample_batch
(batch_size=32)¶
-
store
(obs: numpy.array, act: Union[float, int, numpy.array], rew: Union[float, int], next_obs: numpy.array, done: bool)¶ Append one timestep of agent-environment interaction to the buffer.
-
flare.kindling.loggingfuncs module¶
This file from:
https://github.com/openai/spinningup/blob/master/spinup/utils/logx.py
Some simple logging functionality, inspired by rllab’s logging. Logs to a tab-separated-values file (path/to/output_directory/progress.txt)
-
class
flare.kindling.loggingfuncs.
EpochLogger
(*args, **kwargs)¶ Bases:
flare.kindling.loggingfuncs.Logger
A variant of Logger tailored for tracking average values over epochs. Typical use case: there is some quantity which is calculated many times throughout an epoch, and at the end of the epoch, you would like to report the average / std / min / max value of that quantity. With an EpochLogger, each time the quantity is calculated, you would use .. code-block:: python
epoch_logger.store(NameOfQuantity=quantity_value)
to load it into the EpochLogger’s state. Then at the end of the epoch, you would use .. code-block:: python
epoch_logger.log_tabular(NameOfQuantity, **options)
to record the desired values.
-
get_stats
(key)¶ Lets an algorithm ask the logger for mean/std/min/max of a diagnostic.
-
log_tabular
(key, val=None, with_min_and_max=False, average_only=False)¶ Log a value or possibly the mean/std/min/max values of a diagnostic. :param key: The name of the diagnostic. If you are logging a
diagnostic whose state has previously been saved with
store
, the key here has to match the key you used there.- Parameters
val – A value for the diagnostic. If you have previously saved values for this key via
store
, do not provide aval
here.with_min_and_max (bool) – If true, log min and max values of the diagnostic over the epoch.
average_only (bool) – If true, do not log the standard deviation of the diagnostic over the epoch.
-
store
(**kwargs)¶ Save something into the epoch_logger’s current state. Provide an arbitrary number of keyword arguments with numerical values.
-
-
class
flare.kindling.loggingfuncs.
Logger
(output_dir=None, output_fname='progress.txt', exp_name=None)¶ Bases:
object
A general-purpose logger. Makes it easy to save diagnostics, hyperparameter configurations, the state of a training run, and the trained model.
-
dump_tabular
()¶ Write all of the diagnostics from the current iteration. Writes both to stdout, and to the output file.
-
log
(msg, color='green')¶ Print a colorized message to stdout.
-
log_tabular
(key, val)¶ Log a value of some diagnostic. Call this only once for each diagnostic quantity, each iteration. After using
log_tabular
to store values for each diagnostic, make sure to calldump_tabular
to write them out to file and stdout (otherwise they will not get saved anywhere).
-
save_config
(config)¶ Log an experiment configuration. Call this once at the top of your experiment, passing in all important config vars as a dict. This will serialize the config to JSON, while handling anything which can’t be serialized in a graceful way (writing as informative a string as possible). Example use: .. code-block:: python
logger = EpochLogger(**logger_kwargs) logger.save_config(locals())
-
save_state
(state_dict, itr=None)¶ Saves the state of an experiment. To be clear: this is about saving state, not logging diagnostics. All diagnostic logging is separate from this function. This function will save whatever is in
state_dict
—usually just a copy of the environment—and the most recent parameters for the model you previously set up saving for withsetup_tf_saver
. Call with any frequency you prefer. If you only want to maintain a single state and overwrite it at each call with the most recent version, leaveitr=None
. If you want to keep all of the states you save, provide unique (increasing) values for ‘itr’. :param state_dict: Dictionary containing essential elements todescribe the current state of training.
- Parameters
itr – An int, or None. Current iteration of training.
-
setup_pytorch_saver
(what_to_save)¶ Set up easy model saving for a single PyTorch model. Because PyTorch saving and loading is especially painless, this is very minimal; we just need references to whatever we would like to pickle. This is integrated into the logger because the logger knows where the user would like to save information about this training run. :param what_to_save: Any PyTorch model or serializable object containing
PyTorch models.
-
setup_tf_saver
(sess, inputs, outputs)¶ Set up easy model saving for tensorflow. Call once, after defining your computation graph but before training. :param sess: The Tensorflow session in which you train your computation
graph.
- Parameters
inputs (dict) – A dictionary that maps from keys of your choice to the tensorflow placeholders that serve as inputs to the computation graph. Make sure that all of the placeholders needed for your outputs are included!
outputs (dict) – A dictionary that maps from keys of your choice to the outputs from your computation graph.
-
-
flare.kindling.loggingfuncs.
colorize
(string, color, bold=False, highlight=False)¶ Colorize a string. This function was originally written by John Schulman.
-
flare.kindling.loggingfuncs.
restore_tf_graph
(sess, fpath)¶ Loads graphs saved by Logger. Will output a dictionary whose keys and values are from the ‘inputs’ and ‘outputs’ dict you specified with logger.setup_tf_saver(). :param sess: A Tensorflow session. :param fpath: Filepath to save directory.
- Returns
A dictionary mapping from keys to tensors in the computation graph loaded from
fpath
.
flare.kindling.mpi_pytorch module¶
This file from:
https://github.com/openai/spinningup/blob/master/spinup/utils/mpi_pytorch.py
-
flare.kindling.mpi_pytorch.
mpi_avg_grads
(module)¶ Average contents of gradient buffers across MPI processes.
-
flare.kindling.mpi_pytorch.
setup_pytorch_for_mpi
()¶ Avoid slowdowns caused by each separate process’s PyTorch using more than its fair share of CPU resources.
-
flare.kindling.mpi_pytorch.
sync_params
(module)¶ Sync all parameters of module across all MPI processes.
flare.kindling.mpi_tools module¶
This file from:
https://github.com/openai/spinningup/blob/master/spinup/utils/mpi_tools.py
-
flare.kindling.mpi_tools.
allreduce
(*args, **kwargs)¶
-
flare.kindling.mpi_tools.
broadcast
(x, root=0)¶
-
flare.kindling.mpi_tools.
mpi_avg
(x)¶ Average a scalar or vector over MPI processes.
-
flare.kindling.mpi_tools.
mpi_fork
(n, bind_to_core=False)¶ Re-launches the current script with workers linked by MPI. Also, terminates the original process that launched it. Taken almost without modification from the Baselines function of the same name. .. same name: https://github.com/openai/baselines/blob/master/baselines/common/mpi_fork.py :param n: Number of process to split into. :type n: int :param bind_to_core: Bind each MPI process to a core. :type bind_to_core: bool
-
flare.kindling.mpi_tools.
mpi_op
(x, op)¶
-
flare.kindling.mpi_tools.
mpi_statistics_scalar
(x, with_min_and_max=False)¶ Get mean/std and optional min/max of scalar x across MPI processes. :param x: An array containing samples of the scalar to produce statistics
for.
- Parameters
with_min_and_max (bool) – If true, return min and max of x in addition to mean and std.
-
flare.kindling.mpi_tools.
mpi_sum
(x)¶
-
flare.kindling.mpi_tools.
msg
(m, string='')¶
-
flare.kindling.mpi_tools.
num_procs
()¶ Count active MPI processes.
-
flare.kindling.mpi_tools.
proc_id
()¶ Get rank of calling process.
flare.kindling.neuralnets module¶
-
class
flare.kindling.neuralnets.
CategoricalPolicy
(state_features: int, action_dim: int, hidden_sizes: Union[List, Tuple], activation: Callable, out_activation: Callable)¶ Bases:
torch.nn.modules.module.Module
A class for a Categorical Policy network. Used in discrete action space environments. The policy is an
MLP()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_dim (int) – Dimensionality of the action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
out_activation (Function) – Output activation function for the network.
-
forward
(x: torch.Tensor, a: Optional[torch.Tensor] = None) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
flare.kindling.neuralnets.
FireActorCritic
(state_features: int, action_space: int, hidden_sizes: Union[Tuple, List, None] = (32, 32), activation: Optional[Callable] = <built-in method tanh of type object>, out_activation: Optional[Callable] = None, policy: Optional[torch.nn.modules.module.Module] = None)¶ Bases:
torch.nn.modules.module.Module
An Actor Critic class for Policy Gradient algorithms.
Has built-in capability to work with continuous (gym.spaces.Box) and discrete (gym.spaces.Discrete) action spaces. The policy and value function are both
MLP()
. If working with a different action space, the user can pass in a custom policy class for that action space as an argument.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Space) – Action space of the environment.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
out_activation (Function) – Output activation function for the network.
policy (nn.Module) – Custom policy class for an environment where the action space is not gym.spaces.Box or gym.spaces.Discrete
-
forward
(x: torch.Tensor, a: Optional[torch.Tensor] = None) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
flare.kindling.neuralnets.
FireDDPGActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
An Actor Critic for the DDPG algorithm.
The policy is an
MLPQActor()
and the q-value function is anMLPQFunction()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
-
act
(x: torch.Tensor) → torch.Tensor¶ Get an action from the policy.
- Parameters
x (torch.Tensor) – Observations from the environment.
-
class
flare.kindling.neuralnets.
FireQActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[Tuple, List, None] = (256, 128), activation: Optional[Callable] = <built-in method relu of type object>, out_activation: Optional[Callable] = <class 'torch.nn.modules.linear.Identity'>)¶ Bases:
torch.nn.modules.module.Module
Generic Q Actor Critic class.
Policy is an
MLP()
. Q function is aMLP()
as well.- Parameters
state_features (int) – Dimensionality of state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (tuple or list) – Hidden layer sizes.
activation (Function) – Activation function for the networks.
out_activation (Function) – Output activation for the networks.
-
forward
(x: torch.Tensor, a: torch.Tensor) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor]¶ Get action, q value estimates for action taken, and q value estimates for previous actions.
- Parameters
x (torch.Tensor) – State from the environment.
a (torch.Tensor) – Action taken in the environment.
-
class
flare.kindling.neuralnets.
FireSACActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
An SAC Actor Critic class. From https://github.com/openai/spinningup/blob/master/spinup/algos/pytorch/sac/core.py
The policy is a
SquashedGaussianMLPActor()
and the q-functions are bothMLPQFunctions()
.- Parameters
state_features (int) – Dimensionality of state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the networks.
-
act
(x: torch.Tensor, deterministic: bool = False) → numpy.ndarray¶ Get action from policy.
- Parameters
x (torch.Tensor) – State from the environment.
deterministic (bool) – Whether to act deterministically.
-
class
flare.kindling.neuralnets.
FireTD3ActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
Actor Critic for the TD3 algorithm.
The policy is an
MLPQActor()
and the q-function is anMLPQFunction()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
-
act
(x: torch.Tensor) → torch.Tensor¶ Get an action from the policy.
- Parameters
x (torch.Tensor) – Observations from the environment.
-
class
flare.kindling.neuralnets.
GaussianPolicy
(state_features: int, action_dim: int, hidden_sizes: Union[List, Tuple], activation: Callable, out_activation: Callable)¶ Bases:
torch.nn.modules.module.Module
A class for a Gaussian Policy network. Used in continuous action space environments. The policy is an
MLP()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_dim (int) – Dimensionality of the action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
out_activation (Function) – Output activation function for the network.
-
forward
(x: torch.Tensor, a: Optional[torch.Tensor] = None) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
flare.kindling.neuralnets.
MLP
(layer_sizes: Union[List, Tuple], activations: Optional[Callable] = <built-in method tanh of type object>, out_act: Optional[bool] = None, out_squeeze: Optional[bool] = False)¶ Bases:
torch.nn.modules.module.Module
A class for building a simple MLP network.
- Parameters
layer_sizes (list or tuple) –
Layer sizes for the network. Example:
sizes = (4, 64, 64, 2) mlp = MLP(sizes)
activations (Function) – Activation function for MLP net.
out_act (Function) – Output activation function
out_squeeze (bool) – Whether to squeeze the output of the network.
-
forward
(x: torch.Tensor) → torch.Tensor¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
flare.kindling.neuralnets.
MLPQActor
(state_features: int, action_dim: int, hidden_sizes: Union[list, tuple], activation: Callable, action_limit: Union[float, int])¶ Bases:
torch.nn.modules.module.Module
An actor for Q policy gradient algorithms.
The policy is an
MLP()
. This differs from theFireActorCritic()
class because the output from the policy network is scaled to action space limits on the forward pass.- Parameters
state_features (int) – Dimensionality of the state space.
action_dim (int) – Dimensionality of the action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
action_limit (float or int) – Limits of the action space.
-
forward
(x: torch.Tensor) → torch.Tensor¶ Return output from the policy network scaled to the limits of the env action space.
-
class
flare.kindling.neuralnets.
MLPQFunction
(state_features: int, action_dim: int, hidden_sizes: Union[tuple, list], activation: Callable)¶ Bases:
torch.nn.modules.module.Module
A Q function network for Q policy gradient methods.
The Q function is an
MLP()
. It always takes in a (state, action) pair and returns a Q-value estimate for that pair.- Parameters
state_features (int) – Dimensionality of the state space.
action_dim (int) – Dimensionality of the action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
-
forward
(x: torch.Tensor, a: torch.Tensor) → torch.Tensor¶ Return Q-value estimate for state, action pair (x, a).
- Parameters
x (torch.Tensor) – Environment state.
a (torch.Tensor) – Action taken by the policy.
-
class
flare.kindling.neuralnets.
SquashedGaussianMLPActor
(state_features: int, action_dim: int, hidden_sizes: Union[list, tuple], activation: Callable, action_limit: Union[float, int])¶ Bases:
torch.nn.modules.module.Module
GaussianMLP Actor for SAC. From https://github.com/openai/spinningup/blob/master/spinup/algos/pytorch/sac/core.py
Policy network is an
MLP()
with heads for mean and log standard deviation of the action distribution.- Parameters
state_features (int) – Dimensionality of the state space.
action_dim (int) – Dimensionality of the action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
action_limit (float or int) – Limit of the action space.
-
forward
(x: torch.Tensor, deterministic: bool = False, with_logprob: bool = True) → Tuple[torch.Tensor, torch.Tensor]¶ Get an action and action log prob from the policy.
- Parameters
x (torch.Tensor) – state from the environment.
deterministic (bool) – whether to act deterministically or not.
with_logprob (bool) – whether to return with action log probability or not.
flare.kindling.saver module¶
-
class
flare.kindling.saver.
Saver
(out_dir: str, keys: Optional[list] = [])¶ Bases:
object
A class to pickle generic Python objects saved over a model’s training cycle.
- Parameters
out_dir (str) – Directory to save to.
keys (list) – Keys to initialize the save dictionary with.
-
save
()¶ Write save dictionary to .pkl file.
-
store
(**kwargs)¶ Store input kwargs in save dictionary.
flare.kindling.tblog module¶
-
class
flare.kindling.tblog.
TensorBoardWriter
(fpath: Optional[str] = 'flare_runs')¶ Bases:
object
A writer to log inputs to tensorboard.
- Parameters
fpath (str) – File directory to log to.
-
add_hist
(key: str, val: Union[torch.Tensor, list, numpy.array, tuple], step: int, bins: Optional[str] = 'tensorflow')¶ Helper function to add a vector value to a tensorboard histogram. Called for you in
add_vals()
- Parameters
key (str) – Key to dictionary value to write with.
val (torch.Tensor or np.array or list or tuple) – Value to log to tensorboard.
step (int) – Training step.
bins (str) – binning style for histogram.
-
add_plot
(key: str, val: Union[torch.Tensor, numpy.array, list, float, int], step: int)¶ Helper function to add a scalar value to a tensorboard plot. Called for you in
add_vals()
- Parameters
key (str) – Key to dictionary value to write with.
val (torch.Tensor or np.array or list or float or int) – Value to log to tensorboard.
step (int) – Training step.
-
add_vals
(val_dict: dict, step: int)¶ Add input values to tensorboard.
Can handle scalar and vector input. Scalar values are written to line plots, vector values are written to histograms.
- Parameters
val_dict (dict) – Dictionary of key/value pairs to log to tensorboard.
step (int) – Training step.
-
end
()¶ flush tensorboard writer.
flare.kindling.utils module¶
-
class
flare.kindling.utils.
NetworkUtils
¶ Bases:
object
Random utilities for neural networks.
-
conv2d_output_size
(kernel_size, stride, sidesize)¶
-
squared_error_loss
(target, actual)¶
-
-
class
flare.kindling.utils.
NormalizedActions
(env)¶ Bases:
gym.core.ActionWrapper
Normalize actions for continuous policy
From here: https://github.com/JamesChuanggg/pytorch-REINFORCE/blob/master/normalized_actions.py
-
flare.kindling.utils.
calc_logstd_anneal
(n_anneal_cycles: int, anneal_start: float, anneal_end: float, epochs: int) → numpy.ndarray¶ Calculate log standard deviation annealing schedule. Can be used in PG algorithms on continuous action spaces.
- Parameters
n_anneal_cycles (int) – How many times to cycle from anneal_start to anneal_end over the training epochs.
anneal_start (float) – Starting log standard deviation value.
anneal_end (float) – Ending log standard deviation value.
epochs (int) – Number of training cycles.
-
flare.kindling.utils.
colorize
(string: str, color: int, bold: Optional[bool] = False, highlight: Optional[bool] = False)¶ Colorize a string. This function was originally written by John Schulman.
-
flare.kindling.utils.
save_frames_as_gif
(frames, filename=None)¶ Save a list of frames as a gif
This code from this floydhub blog post: https://blog.floydhub.com/spinning-up-with-deep-reinforcement-learning/
Module contents¶
-
class
flare.kindling.
FireActorCritic
(state_features: int, action_space: int, hidden_sizes: Union[Tuple, List, None] = (32, 32), activation: Optional[Callable] = <built-in method tanh of type object>, out_activation: Optional[Callable] = None, policy: Optional[torch.nn.modules.module.Module] = None)¶ Bases:
torch.nn.modules.module.Module
An Actor Critic class for Policy Gradient algorithms.
Has built-in capability to work with continuous (gym.spaces.Box) and discrete (gym.spaces.Discrete) action spaces. The policy and value function are both
MLP()
. If working with a different action space, the user can pass in a custom policy class for that action space as an argument.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Space) – Action space of the environment.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
out_activation (Function) – Output activation function for the network.
policy (nn.Module) – Custom policy class for an environment where the action space is not gym.spaces.Box or gym.spaces.Discrete
-
forward
(x: torch.Tensor, a: Optional[torch.Tensor] = None) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
flare.kindling.
FireQActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[Tuple, List, None] = (256, 128), activation: Optional[Callable] = <built-in method relu of type object>, out_activation: Optional[Callable] = <class 'torch.nn.modules.linear.Identity'>)¶ Bases:
torch.nn.modules.module.Module
Generic Q Actor Critic class.
Policy is an
MLP()
. Q function is aMLP()
as well.- Parameters
state_features (int) – Dimensionality of state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (tuple or list) – Hidden layer sizes.
activation (Function) – Activation function for the networks.
out_activation (Function) – Output activation for the networks.
-
forward
(x: torch.Tensor, a: torch.Tensor) → Tuple[torch.Tensor, torch.Tensor, torch.Tensor]¶ Get action, q value estimates for action taken, and q value estimates for previous actions.
- Parameters
x (torch.Tensor) – State from the environment.
a (torch.Tensor) – Action taken in the environment.
-
class
flare.kindling.
FireDDPGActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
An Actor Critic for the DDPG algorithm.
The policy is an
MLPQActor()
and the q-value function is anMLPQFunction()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
-
act
(x: torch.Tensor) → torch.Tensor¶ Get an action from the policy.
- Parameters
x (torch.Tensor) – Observations from the environment.
-
class
flare.kindling.
FireTD3ActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
Actor Critic for the TD3 algorithm.
The policy is an
MLPQActor()
and the q-function is anMLPQFunction()
.- Parameters
state_features (int) – Dimensionality of the state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the network.
-
act
(x: torch.Tensor) → torch.Tensor¶ Get an action from the policy.
- Parameters
x (torch.Tensor) – Observations from the environment.
-
class
flare.kindling.
FireSACActorCritic
(state_features: int, action_space: gym.spaces.box.Box, hidden_sizes: Union[tuple, list, None] = (256, 256), activation: Optional[Callable] = <built-in method relu of type object>)¶ Bases:
torch.nn.modules.module.Module
An SAC Actor Critic class. From https://github.com/openai/spinningup/blob/master/spinup/algos/pytorch/sac/core.py
The policy is a
SquashedGaussianMLPActor()
and the q-functions are bothMLPQFunctions()
.- Parameters
state_features (int) – Dimensionality of state space.
action_space (gym.spaces.Box) – Environment action space.
hidden_sizes (list or tuple) – Hidden layer sizes.
activation (Function) – Activation function for the networks.
-
act
(x: torch.Tensor, deterministic: bool = False) → numpy.ndarray¶ Get action from policy.
- Parameters
x (torch.Tensor) – State from the environment.
deterministic (bool) – Whether to act deterministically.
-
class
flare.kindling.
TensorBoardWriter
(fpath: Optional[str] = 'flare_runs')¶ Bases:
object
A writer to log inputs to tensorboard.
- Parameters
fpath (str) – File directory to log to.
-
add_hist
(key: str, val: Union[torch.Tensor, list, numpy.array, tuple], step: int, bins: Optional[str] = 'tensorflow')¶ Helper function to add a vector value to a tensorboard histogram. Called for you in
add_vals()
- Parameters
key (str) – Key to dictionary value to write with.
val (torch.Tensor or np.array or list or tuple) – Value to log to tensorboard.
step (int) – Training step.
bins (str) – binning style for histogram.
-
add_plot
(key: str, val: Union[torch.Tensor, numpy.array, list, float, int], step: int)¶ Helper function to add a scalar value to a tensorboard plot. Called for you in
add_vals()
- Parameters
key (str) – Key to dictionary value to write with.
val (torch.Tensor or np.array or list or float or int) – Value to log to tensorboard.
step (int) – Training step.
-
add_vals
(val_dict: dict, step: int)¶ Add input values to tensorboard.
Can handle scalar and vector input. Scalar values are written to line plots, vector values are written to histograms.
- Parameters
val_dict (dict) – Dictionary of key/value pairs to log to tensorboard.
step (int) – Training step.
-
end
()¶ flush tensorboard writer.
-
class
flare.kindling.
ReplayBuffer
(obs_dim: Union[tuple, int], act_dim: Union[tuple, int], size: int)¶ Bases:
flare.kindling.buffers.PGBuffer
A replay buffer for off-policy RL agents.
-
store
(obs: numpy.array, act: Union[float, int, numpy.array], rew: Union[float, int], next_obs: numpy.array, done: bool)¶ Append one timestep of agent-environment interaction to the buffer.
-
-
class
flare.kindling.
PGBuffer
(obs_dim: Union[tuple, int], act_dim: Union[tuple, int], size: int, gamma: Optional[float] = 0.99, lam: Optional[float] = 0.95)¶ Bases:
object
A buffer for storing trajectories experienced by an agent interacting with the environment, and using Generalized Advantage Estimation (GAE-Lambda) for calculating the advantages of state-action pairs.
-
finish_path
(last_val: Union[int, float, numpy.array, None] = 0)¶ Call this at the end of a trajectory, or when one gets cut off by an epoch ending. This looks back in the buffer to where the trajectory started, and uses rewards and value estimates from the whole trajectory to compute advantage estimates with GAE-Lambda, as well as compute the rewards-to-go for each state, to use as the targets for the value function. The “last_val” argument should be 0 if the trajectory ended because the agent reached a terminal state (died), and otherwise should be V(s_T), the value function estimated for the last state. This allows us to bootstrap the reward-to-go calculation to account for timesteps beyond the arbitrary episode horizon (or epoch cutoff).
-
get
()¶ Call this at the end of an epoch to get all of the data from the buffer, with advantages appropriately normalized (shifted to have mean zero and std one). Also, resets some pointers in the buffer.
-
store
(obs: numpy.array, act: numpy.array, rew: Union[int, float, numpy.array], val: Union[int, float, numpy.array], logp: Union[float, numpy.array])¶ Append one timestep of agent-environment interaction to the buffer.
-
-
class
flare.kindling.
Saver
(out_dir: str, keys: Optional[list] = [])¶ Bases:
object
A class to pickle generic Python objects saved over a model’s training cycle.
- Parameters
out_dir (str) – Directory to save to.
keys (list) – Keys to initialize the save dictionary with.
-
save
()¶ Write save dictionary to .pkl file.
-
store
(**kwargs)¶ Store input kwargs in save dictionary.
-
class
flare.kindling.
Logger
(output_dir=None, output_fname='progress.txt', exp_name=None)¶ Bases:
object
A general-purpose logger. Makes it easy to save diagnostics, hyperparameter configurations, the state of a training run, and the trained model.
-
dump_tabular
()¶ Write all of the diagnostics from the current iteration. Writes both to stdout, and to the output file.
-
log
(msg, color='green')¶ Print a colorized message to stdout.
-
log_tabular
(key, val)¶ Log a value of some diagnostic. Call this only once for each diagnostic quantity, each iteration. After using
log_tabular
to store values for each diagnostic, make sure to calldump_tabular
to write them out to file and stdout (otherwise they will not get saved anywhere).
-
save_config
(config)¶ Log an experiment configuration. Call this once at the top of your experiment, passing in all important config vars as a dict. This will serialize the config to JSON, while handling anything which can’t be serialized in a graceful way (writing as informative a string as possible). Example use: .. code-block:: python
logger = EpochLogger(**logger_kwargs) logger.save_config(locals())
-
save_state
(state_dict, itr=None)¶ Saves the state of an experiment. To be clear: this is about saving state, not logging diagnostics. All diagnostic logging is separate from this function. This function will save whatever is in
state_dict
—usually just a copy of the environment—and the most recent parameters for the model you previously set up saving for withsetup_tf_saver
. Call with any frequency you prefer. If you only want to maintain a single state and overwrite it at each call with the most recent version, leaveitr=None
. If you want to keep all of the states you save, provide unique (increasing) values for ‘itr’. :param state_dict: Dictionary containing essential elements todescribe the current state of training.
- Parameters
itr – An int, or None. Current iteration of training.
-
setup_pytorch_saver
(what_to_save)¶ Set up easy model saving for a single PyTorch model. Because PyTorch saving and loading is especially painless, this is very minimal; we just need references to whatever we would like to pickle. This is integrated into the logger because the logger knows where the user would like to save information about this training run. :param what_to_save: Any PyTorch model or serializable object containing
PyTorch models.
-
setup_tf_saver
(sess, inputs, outputs)¶ Set up easy model saving for tensorflow. Call once, after defining your computation graph but before training. :param sess: The Tensorflow session in which you train your computation
graph.
- Parameters
inputs (dict) – A dictionary that maps from keys of your choice to the tensorflow placeholders that serve as inputs to the computation graph. Make sure that all of the placeholders needed for your outputs are included!
outputs (dict) – A dictionary that maps from keys of your choice to the outputs from your computation graph.
-
-
class
flare.kindling.
EpochLogger
(*args, **kwargs)¶ Bases:
flare.kindling.loggingfuncs.Logger
A variant of Logger tailored for tracking average values over epochs. Typical use case: there is some quantity which is calculated many times throughout an epoch, and at the end of the epoch, you would like to report the average / std / min / max value of that quantity. With an EpochLogger, each time the quantity is calculated, you would use .. code-block:: python
epoch_logger.store(NameOfQuantity=quantity_value)
to load it into the EpochLogger’s state. Then at the end of the epoch, you would use .. code-block:: python
epoch_logger.log_tabular(NameOfQuantity, **options)
to record the desired values.
-
get_stats
(key)¶ Lets an algorithm ask the logger for mean/std/min/max of a diagnostic.
-
log_tabular
(key, val=None, with_min_and_max=False, average_only=False)¶ Log a value or possibly the mean/std/min/max values of a diagnostic. :param key: The name of the diagnostic. If you are logging a
diagnostic whose state has previously been saved with
store
, the key here has to match the key you used there.- Parameters
val – A value for the diagnostic. If you have previously saved values for this key via
store
, do not provide aval
here.with_min_and_max (bool) – If true, log min and max values of the diagnostic over the epoch.
average_only (bool) – If true, do not log the standard deviation of the diagnostic over the epoch.
-
store
(**kwargs)¶ Save something into the epoch_logger’s current state. Provide an arbitrary number of keyword arguments with numerical values.
-


Usage¶
Running examples¶
Two examples come bundled along with the kanapy package. You can run them individually by navigating into the corresponding directories and executing them as shown:
Note
Make sure that you are within the virtual environment created during the kanapy installation, as this environment contains the installed kanapy and its required dependencies.
$ conda activate myenv
(myenv) $ cd kanapy-master/examples/
(myenv) $ cd sphere_packing/
(myenv) $ python sphere_pack.py
You can view the data generated by the simulation (after the simulation
is complete or during the simulation) by launching OVITO and reading in
the dump files generated by kanapy from the ../sphere_packing/dump_files/
directory.
The UI should look similar to this:
By default, OVITO loads the particles as spheres, this option can be changed to visualize ellipsoids.
The asphericalshapex, asphericalshapey, and asphericalshapez columns need to be mapped to
Aspherical Shape.X, Aspherical Shape.Y, and Aspherical Shape.Z properties of OVITO when
importing the dump file. Similarily, the orientationx, orientationy, orientationz, and
orientationw particle properties need to be mapped to the Orientation.X, Orientation.Y,
Orientation.Z, and Orientation.W. OVITO cannot set up this mapping automatically, you have
to do it manually by using the Edit column mapping
button (at the bottom-right corner
of the GUI) in the file import panel after loading the dump files. The required assignment
and components are shown here:
For further viewing customizations refer to OVITO’s documentation.
Detailed tutorial¶
A detailed description of the default examples that come packaged with kanapy is presented here.
The two examples sphere_packing
and ellipsoid_packing
depict the different workflows
that have to be setup for generating synthetic microstructures with equiaxed and elongated
grains. Both examples contain an input file wherein the user can specify
the statistical parameters required for the simulation. For a detailed understanding of the
general framework of packing simulations, please refer to: Modeling.
Note
New examples must be created in a separate directory under the
kanapy-master/examples/
directory structure. It allows the kanapy modules an easy access to the json and dump files created during the simulation.The json and dump files help in making the various kanapy modules independent of one another during execution.
The input file must always be named as:
stat_input.txt
to be read by kanapy.
Input file structure¶
An exemplary structure of the input file: stat_input.txt
is shown below:
@ Equivalent diameter
std =
mean =
cutoff_min =
cutoff_max =
@ Aspect ratio
mean =
@ Orientation
sigma =
mean =
@ RVE
side_length =
voxel_per_side =
@ Simulation
nsteps =
periodicity =
The input file is built with the following keywords: @ Equivalent diameter, @ Aspect ratio,
@ Orientation, @ RVE, @ Simulation
.
The keyword
@ Equivalent diameter
takes in four arguments to generate a log-normal distribution for the particle’s equivalent diameter; they are the Log-normal distribution’s standard deviation and mean, and the minimum and maximum cut-off values for the diameter. The values should correspond to \(\mu m\) scale.The
@ Aspect ratio
takes only the mean value as input. If the resultant microstructure contains equiaxed grains then this value should be set to 1.The
@ Orientation
keyword represents the tilt angle of particles with respect to the positive x-axis. Hence, to generate a distribution, it takes in two arguments: the normal distribution’s mean and the standard deviation.The
@ RVE
keyword takes two inputs: the side length of the final RVE required and the number of voxels per RVE side length.The
@ Simulation
keyword takes in two inputs: The total number of time steps and a boolean value for periodicity (True/False).
Note
The user may choose not to use the built-in voxelization (meshing) routine for meshing the final RVE. Nevertheless, a value for voxel_per_side has to be provided.
A good estimation for voxel_per_side value can be made by keeping the following point in mind: The smallest dimension of the smallest ellipsoid/sphere should contain at least 3 voxels.
The nsteps value determines the growth of the particle during the simulation. At the start of the simulation, all particles are initialized with null volume. At each time step, they grow in size by the value: diameter/nsteps. Therefore, the last timestep would naturally contain particles in their actual size.
Example workflows¶
Sphere packing¶
This example demonstrates the workflow for generating synthetic microstructures with equiaxed grains. The principle involved in generating such microstructures are described in the sub-section Microstructure with equiaxed grains. With respect to the final RVE mesh, the user has the flexibility to choose between the in-built voxelization routine and external meshing softwares.
If external meshing is required, the positions and weights of the particles (spheres) after packing can be written out to be post-processed. The positions and weights can be read by the Voronoi tessellation and meshing software Neper for generating tessellations and FEM mesh. For more details refer to Neper’s documentation.
If the in-built voxelization routine is prefered, then the Module voxelization will generate hexahedral element (C3D8) mesh that can be read by the commercial FEM software Abaqus. The Abaqus .inp file will be written out in \(mm\) scale.
Imports: This example requires the following imports from the Python standard and kanapy modules.
import os
import sys
import kanapy
from kanapy.input_output import particleStatGenerator
from kanapy.input_output import write_position_weights
from kanapy.packing import packingRoutine
The methods for generating particle distribution statistics and outputing particle
position- and weights are imported from the input_output
module. The routine
for the actual particle packing simulation is imported from the packing
module.
Workflow: The complete process consists of 3 stages:
Particle data generation.
Particle packing simulation.
Writing output files.
def main():
inputFile = os.getcwd() + '/stat_input.txt'
particleStatGenerator(inputFile)
packingRoutine()
write_position_weights(800)
return
if __name__ == '__main__':
main()
Note
Individual stages can be run by commenting out the other stages but should be done sequentially.
The
src.kanapy.input_output.particleStatGenerator()
method requires thestat_input.txt
as input.The
src.kanapy.input_output.write_position_weights()
method requires the simulation timestep as input. The choice of the timestep is very important. It is suggested to choose the time step at which the spheres are tightly packed and at which there is the least amount of overlap. The remaining empty spaces will get assigned to the closest sphere when it is sent to the tessellation and meshing routine. Please refer to Microstructure with equiaxed grains for more details.
The data required for the packing simulation contained in the user-defined input file: stat_input.txt
is read
by the method src.kanapy.input_output.particleStatGenerator()
. It generates the necessary particle, RVE, and
the simulation attributes, and it writes it to json files. The method src.kanapy.packing.packingRoutine()
, when
called, looks for the json files generated by src.kanapy.input_output.particleStatGenerator()
and reads the files for extracting the information required for the packing simulation. At each time step of the
packing simulation, the src.kanapy.packing.particle_grow()
method will write out a dump file containing information
of particle positions and other attributes.
Finally, the src.kanapy.input_output.write_position_weights()
method can be called
to write out the position and weights files required for further post-processing. This function takes the
specified timestep value as an input parameter and reads the corresponding, previously generated dump file.
By extracting the particle’s position and dimensions, it creates the sphere_positions.txt
&
sphere_weights.txt
files.
Note
For comparing the input and output statistics:
The json file
particle_data.txt
in the directory../json_files/
can be used to read the particle’s equivalent diameter as input statistics.After tessellation, Neper can be used to generate the equivalent diameter for output statistics.
If the built-in voxelization is prefered, then the src.kanapy.voxelization.voxelizationRoutine()
method can be called
to generate the hexahedral mesh. This function also takes in the timestep value as an input parameter and reads the
corresponding, previously generated dump file. The src.kanapy.input_output.write_abaqus_inp()
method can be called to
write out the Abaqus (.inp) input file. The Abaqus (.inp) file will be written out in \(mm\) scale. The workflow for this looks like:
from kanapy.voxelization import voxelizationRoutine
from kanapy.input_output import write_abaqus_inp, write_output_stat
def main():
inputFile = os.getcwd() + '/stat_input.txt'
particleStatGenerator(inputFile)
packingRoutine()
voxelizationRoutine(800)
write_abaqus_inp()
write_output_stat()
return
if __name__ == '__main__':
main()
Note
For comparing the input and the output equivalent diameter statistics the method
src.kanapy.input_output.write_output_stat()
can be called.
Storing information in json & dump files is effective in making the workflow stages independent of one another. But the sequence of the workflow is important, for example: Running the packing routine before the statistics generation is not advised as the packing routine would not have any input to work on. Both the json and the dump files are human readable, and hence they help the user debug the code in case of simulation problems. As mentioned earlier, the dump files can be read by the visualization software OVITO; this provides the user a visual aid to understand the physics behind packing.
Ellipsoid packing¶
This example demonstrates the workflow for generating synthetic microstructures with elongated grains. The principle involved in generating such microstructures is described in the sub-section Microstructure with elongated grains. With respect to the final RVE mesh, the built-in voxelization routine has to be used due to the inavailability of anisotropic tessellation techniques. The Module voxelization will generate a hexahedral element (C3D8) mesh that can be read by the commercial FEM software Abaqus.
Imports: This example requires the following methods to be imported from kanapy modules.
import os
import sys
import kanapy
from kanapy.input_output import particleStatGenerator
from kanapy.input_output import write_abaqus_inp, write_output_stat
from kanapy.packing import packingRoutine
from kanapy.voxelization import voxelizationRoutine
The methods for generating particle distribution statistics and for outputing the Abaqus input file
are imported from the input_output
module. The routine for the actual particle packing
simulation is imported from the packing
module. And the routine for generating hexahedral mesh
is imported from the voxelization
module.
Workflow: The complete process consists of 4 stages:
Particle data generation.
Particle packing simulation.
RVE voxelization.
Writing output files.
def main():
inputFile = os.getcwd() + '/stat_input.txt'
particleStatGenerator(inputFile)
packingRoutine()
voxelizationRoutine(800)
write_abaqus_inp()
write_output_stat()
return
if __name__ == '__main__':
main()
Note
As mentioned previously, individual stages can be run by commenting out the other stages but should be done sequentially.
The
src.kanapy.input_output.particleStatGenerator()
method requires thestat_input.txt
as input.The
src.kanapy.voxelization.voxelizationRoutine()
method requires the simulation timestep as input. The choice of the timestep is very important. It is suggested to choose the time step at which the ellipsoids are tightly packed and there is the least amount of overlap. The remaining empty spaces will get assigned to the closest ellipsoid when it is sent to the voxelization (meshing) routine. Please refer to Microstructure with elongated grains for more details.For comparing the input and output equivalent, major and minor diameter statistics, the method
src.kanapy.input_output.write_output_stat()
can be called.
The process of the methods src.kanapy.input_output.particleStatGenerator()
and src.kanapy.packing.packingRoutine()
is similar to that described in Sphere packing. But for voxelization, the src.kanapy.voxelization.voxelizationRoutine()
method is called to generate the hexahedral mesh. It takes in the timestep value as an input parameter and reads the corresponding,
previously generated dump file. By extracting the particle’s position and dimensions, it creates the final FEM mesh. Finally,
the src.kanapy.input_output.write_abaqus_inp()
method can be called to write out the Abaqus (.inp) input file.


{% extends "cab/snippet_list.html" %} {% block head_title %}Top-rated snippets{% if months %} last {{ months }} months{% endif %}{% endblock %} {% block content_header %}Top-rated snippets{% if months %} last {{ months }} months{% endif %}{% endblock %} {% block sidebar %}
You're looking at the top-rated snippets currently on the site; {% if user.is_authenticated %}if you'd like to contribute, just click the ratings link in the sidebar of a particular snippet's page; you can rate any snippet "useful" or "not useful"{% else %}if you'd like to contribute, sign up for an account and you'll be able to rate any snippet you see{% endif %}.
{{ block.super }} {% endblock %}


UBC Zoology Huts Skit Music Videos
Warning: subject matter may contain too many inside jokes for some viewers.
Bird Clines (2013)
Birds Hit Windows (2017)
All About That Base (R) (2017)


@(user: models.users.User)
@main("About", user) {
JAS Basketball are the leading providers for Basketball Apparel and Equipment in Ireland. We provide a vast range of products such as offical NBA kits, Shoes, T-Shirts, Hats, equipment and much more. All available at great pricesAbout Us
We offer high quality products from the best sports brands around.
JAS Basketball take great pride in providing our customers with Apparel & Equipment that is held to the highest standard, We want to supply you with exactly what you need. Whether its Training Gear or Fashion wear we have something for every occassion.


Here are seven positions of the C major scale shown with three notes per string. They are styled to indicate fingering with the index finger in red, middle in orange, ring finger in yellow, and pinky in green. These seven positions also serve as a map to the formation of the seven modes, and are labeled as such here.
Made with Picker.js.