Install working tensorflow or pytorch via standard conda environment workflow.
The recommended conda-based install process works smoothly:
$ # Create a fresh environment| ''' | |
| Computing marginal log likelihood of data for unknown mean, fixed variance model. | |
| Running Demo | |
| ------------ | |
| $ python marg_lik_of_normal.py | |
| This will compare numerical and exact methods for calculating marg. lik. | |
| By visual inspection, user can see the exact method matches numerical. |
We assume that there are two users (A and B). A is gonna delete the bad files. B is gonna receive the changes.
At the start, we need A and B to have the SAME version history.
We'll assume there are no branches other than master.
| import numpy as np | |
| import pandas as pd | |
| import argparse | |
| def convert_ordered_dx_df_to_indicator_df( | |
| ordered_dx_df, | |
| list_of_possible_icd_code_values=None, | |
| list_of_possible_icd_code_names=None): | |
| ''' Convert rank-ordered diagnosis codes into indicator format |
| import pandas as pd | |
| import numpy as np | |
| import time | |
| prng = np.random.RandomState(0) | |
| n_subj = 20000 | |
| n_rows = 1000000 | |
| # Randomly assign to one of 20000 subjects |
| S = 10 # num samples throughout | |
| ## FIRST, REMEMBER THE COMMON PARAMETERIZATION | |
| # x ~ Normal(m, sigma^2) | |
| # m is a real number | |
| # sigma >= 0 is a standard deviation | |
| m = 2 | |
| sigma = 0.1 |
| ## Using notation from HDP-HMM paper in NeurIPS 2015 (Hughes, Stephenson, Sudderth) | |
| ## Start for a single sequence of interest, | |
| ## Compute the following as in the tutorial here: | |
| https://bnpy.readthedocs.io/en/latest/examples/08_mocap6/plot-03-demo=interpret_hdphmm_params_and_run_viterbi.html#sphx-glr-examples-08-mocap6-plot-03-demo-interpret-hdphmm-params-and-run-viterbi-py | |
| # start_prob_K : 1D array size K, sums to one | |
| # trans_proba_KK : 2D array, size K x K, rows sum to one | |
| # log_lik_seq_TK : 2D array, size T x K |
| import numpy as np | |
| import scipy.stats | |
| from scipy.special import logsumexp, softmax | |
| np.set_printoptions(precision=3, suppress=1) | |
| ## Settings | |
| ## -------- |
| sacct -j 56012984_1.batch --format=jobid,jobname,partition,maxvmsize,maxrss,state,elapsed,reqmem,reqcpus |