This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html class="theme theme--mercado artdeco" lang="en"><head> | |
| <script async="" src="https://platform.linkedin.com/js/analytics.js"></script><script type="application/javascript">!function(i,n){void 0!==i.addEventListener&&void 0!==i.hidden&&(n.liVisibilityChangeListener=function(){i.hidden&&(n.liHasWindowHidden=!0)},i.addEventListener("visibilitychange",n.liVisibilityChangeListener))}(document,window);</script> | |
| <title>(7) Assaf Govari, Ph.D. | LinkedIn</title> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="asset-url" class="mercado-icons-sprite" id="artdeco-icons/static/images/sprite-asset" content="https://static-exp1.licdn.com/sc/h/brlx1tn7p1njjhu3u6kjxqodw"> | |
| <meta name="description" content=""> | |
| <meta name="google" content="notranslate"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib_venn import venn2, venn3 | |
| import matplotlib.pyplot as plt | |
| # venn2 subsets are a b ab (where a is n_unique_to_a, ab is intersection of a,b) | |
| # called by venn2(subsets = (a_name,b_name,intersection_name), set_labels = (pair[0], pair[1],'both'), alpha = 0.5) | |
| # venn3 subsets are a b ab c ca cb abc | |
| # called by venn3(subsets = (a,b,ab,c,ca,cb,n), | |
| # set_labels = (a_name,b_name,c_name), alpha = 0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jeremy@jeremy-Blade:$ gs \ | |
| -sOutputFile=output.pdf \ | |
| -sDEVICE=pdfwrite \ | |
| -sColorConversionStrategy=Gray \ | |
| -dProcessColorModel=/DeviceGray \ | |
| -dCompatibilityLevel=1.4 \ | |
| -dNOPAUSE \ | |
| -dBATCH \ | |
| input.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Some notes on torchtext | |
| you can read a csv and generate vocab like this | |
| tokenize = lambda x: str(x).split() # see if this fixes float vs. string error | |
| TEXT = data.Field(sequential=True, tokenize=tokenize, lower=True, include_lengths=True, batch_first=True, | |
| fix_length=200) | |
| LABEL = data.LabelField() # LABEL = data.LabelField(tensor_type=torch.FloatTensor) | |
| fields = {'textcol': ('text', TEXT), 'real': ('label',LABEL)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # selecting all cols except one | |
| df = pd.DataFrame({'a':[1,2,3,4],'b':[1,2,3,4]}) | |
| df2 = df.loc[:,df.columns!='b'] | |
| print(df) | |
| print(df2) | |
| # split df into train, val, test with val from 0.9 to 0.95 and test from 0.95 to 1.0 of randomized data | |
| train, validate, test = np.split(df.sample(frac=1), [int(.9*len(df)), int(.95*len(df))]) | |
| # FILTERING |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # attempt at 'batch-known' learning , where positive/negative is known per batch and not per example | |
| # in this attempt, examples are positive if there are five or more ones in the input vector which is itself six random binary digits. | |
| # not only is this underlying truth (y=(sum(x)>=5)) hidden from the loss function , the loss func will only know per batch if there was at | |
| # least one true example in the batch (a 'positive batch'), or none (a 'negative batch') | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tl;dr | |
| use the package manager install (.deb or .rpm files, not .run file) | |
| remove stuff using | |
| sudo apt-get --purge remove 'cuda*' | |
| sudo apt-get --purge -y remove 'nvidia*' | |
| sudo apt-get --purge -y remove 'libnvidia*' | |
| using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # code for https://unclejerry9466728.wordpress.com/2019/12/28/wiser-geyser/ | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| import torch | |
| import numpy as np | |
| import pandas as pd | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import cv2 | |
| def remap_test(img_arr): | |
| H,W = img_arr.shape[0:2] | |
| map = np.mgrid[0:H,0:W] # the map doesnt have to be same dims. as image size; it just declares what pixels in input image map to given output pixel | |
| map_x = map[1].astype(np.float32) | |
| map_y = map[0].astype(np.float32) | |
| #linear warp | |
| # for i in range(H): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| def get_rgb(two_d_pixels): | |
| theta = np.arctan(two_d_pixels[1,:] / two_d_pixels[0,:]) | |
| r = np.sqrt(two_d_pixels[1,:]**2 + two_d_pixels[0,:]**2) | |
| hue = (theta+3.14/2) * 128./(3.14) # 127 max for hue | |
| sat = (r/np.sqrt(2)) * 255 #255 max for sat | |
| H,W = two_d_pixels.shape[1:3] | |
| retval = np.zeros([H,W,3],dtype = np.uint8) | |
| retval[:,:,0] = hue |