 CCR (Corners of Circumscribing Coordinate Rectangle) (rnd-f, rnd-g, then lin-d) f=MinVecXŌēĪ(minXx1..minXxn) gŌēĪMaxVecXŌēĪ(maxXx1..maxXxn), dŌēĪ(g-f)/|g-f| Sequence thru main diagonal pairs, {f, g} lexicographically. For each, create d. Notes: No calculation required to find f and g (assuming f1=MnVec RnGp>4 none start ’é« g1=MxVec RnGp>4 Sub 0 7 vir18... Clus1 1 47 ver30 Sub 0 53 ver49.. Clus2 0 74 set14 SubClus1 Lin>4 none f2=0001 RnGp>4 none CCR-1. Do SpS((x-f)o(x-f)) round gap analysis CCR-2. Do SpS((x-g)o(x-g)) rnd gap analysis. CCR-3. Do SpS((xod)) linear gap analysis. SubCluster2 g2=1110 RnGp>4 none This ends SubClus2 = 47 setosa only Lin>4 none f1=0000 RnGp>4 none g1=1111 RnGp>4 none Lin>4 none f3=0010 RnGp>4 none f2=0001 RnGp>4 none g2=1110 RnGp>4 none Lin>4 none Lin>4 none f3=0010 RnGp>4 none g3=1101 RnGp>4 none Lin>4 none f4=0011 RnGp>4 none f4=0011 RnGp>4 none g4=1100 RnGp>4 none Lin>4 none f5=0100 RnGp>4 none g5=1011 RnGp>4 none Lin>4 none g3=1101 RnGp>4 none g4=1100 RnGp>4 none Lin>4 none f5=0100 RnGp>4 none g5=1011 RnGp>4 none Lin>4 none f6=0101 RnGp>4 none g6=1010 RnGp>4 none f6=0101 RnGp>4 1 19 set26 0 28 ver49 0 31 set42 0 31 ver8 0 32 set36 0 32 ver44 1 35 ver11 0 41 ver13 ver49 0.0 19.8 3.9 21.3 3.9 7.2 Lin>4 none f7=0110 RnGp>4 none g7=1001 RnGp>4 none Lin>4 none f8=0111 RnGp>4 none g8=1000 RnGp>4 none Lin>4 none f7=0110 RnGp>4 1 28 ver13 0 33 vir49 f8=0111 RnGp>4 none set42 ver8 19.8 3.9 0.0 21.6 21.6 0.0 10.4 23.9 21.8 1.4 23.8 4.6 set36 ver44 ver11 21.3 3.9 7.2 10.4 21.8 23.8 23.9 1.4 4.6 0.0 24.2 27.1 24.2 0.0 3.6 27.1 3.6 0.0 g6=1010 RnGp>4 none g7=1001 RnGp>4 none g8=1000 RnGp>4 none Lin>4 none Lin>4 none Lin>4 none MaxVecX and MinVecX have been calculated and residualized when PTreeSetX was captured.) 3. (and 2.?) may be unproductive in finding new subclusters (either because 1 finds almost all or because 2 and/or 3 find the same ones) and could be skipped (very likely if dimension is high, since the main diagonal corners are typically far from X, in a high dimensional vector space and thus the radii of a round gap is large and large radii rnd gaps are near linear, suggesting a will find all the subclusters that b and c would find. 2. good!, else setosa/versicolor+virginica are not separated! 3. is unproductive, suggesting productive to calculate 1., 2. but having done that, 3. will probably not be productive. Next consider only 3. to see if it is as productive as 1.+2. Subc2.1 ver49 ver8 ver44 ver11 CCR is as good as the combo (projection on d appears to be as accurate as the combination of square length of f and of g). This is probably because the round gaps (centered at the corners) are nearly linear by the time they get to the set X itself. To compare the time costs, we note: Combo (p-x)o(p-x) = pop + xox2xop = pop + ’āźk=1..nxk2 + ’āźk=1..n(-2pk)xk has n multiplications in the second term, n scalar multiplications and n additions in the third term. For both p=f and p=g, then, it takes 2n multiplications, 2n scalar multiplications and 2n additions. For CCR, xod = ’āźk=1..n(dk)xk involves n scalar mults and n additions. It appears to be cheaper (timewise) This ends SubClus1 = 95 ver and vir samples only
View full slide show CCR(fgd) (Corners of Circumscribing Coordinate Rectangle) f1=minVecXŌēĪ(minXx1..minXxn) (0000) g1=MaxVecXŌēĪ(MaxXx1..MaxXxn) (1111), d=(g-f)/|g-f| Sequence thru main diagonal pairs, {f, g} lexicographically. For each, create d. f1=MnVec RnGp>4 none start ’é« g1=MxVec RnGp>4 Sub 0 7 vir18... Clus1 1 47 ver30 Sub 0 53 ver49.. Clus2 0 74 set14 SubClus1 Lin>4 none f2=0001 RnGp>4 none CCR(f) Do SpS((x-f)o(x-f)) round gap analysis CCR(g) Do SpS((x-g)o(x-g)) round gap analysis. CCR(d) Do SpS((xod)) linear gap analysis. Notes: No calculation required to find f and g (assuming MaxVecX and minVecX have been calculated and residualized when PTreeSetX was captured.) SubCluster2 g2=1110 RnGp>4 none This ends SubClus2 = 47 setosa only Lin>4 none f1=0000 RnGp>4 none g1=1111 RnGp>4 none Lin>4 none f3=0010 RnGp>4 none f2=0001 RnGp>4 none g2=1110 RnGp>4 none Lin>4 none Lin>4 none f3=0010 RnGp>4 none g3=1101 RnGp>4 none Lin>4 none f4=0011 RnGp>4 none f4=0011 RnGp>4 none g4=1100 RnGp>4 none Lin>4 none f5=0100 RnGp>4 none g5=1011 RnGp>4 none Lin>4 none If the dimension is high, since the main diagonal corners are liekly far from X and thus the large radii make the round gaps nearly linear. g3=1101 RnGp>4 none g4=1100 RnGp>4 none Lin>4 none f5=0100 RnGp>4 none g5=1011 RnGp>4 none Lin>4 none f6=0101 RnGp>4 none g6=1010 RnGp>4 none f6=0101 RnGp>4 1 19 set26 0 28 ver49 0 31 set42 0 31 ver8 0 32 set36 0 32 ver44 1 35 ver11 0 41 ver13 ver49 0.0 19.8 3.9 21.3 3.9 7.2 Lin>4 none f7=0110 RnGp>4 none g7=1001 RnGp>4 none Lin>4 none f8=0111 RnGp>4 none f7=0110 RnGp>4 1 28 ver13 0 33 vir49 f8=0111 RnGp>4 none set42 ver8 19.8 3.9 0.0 21.6 21.6 0.0 10.4 23.9 21.8 1.4 23.8 4.6 g6=1010 RnGp>4 none g7=1001 RnGp>4 none g8=1000 RnGp>4 none g8=1000 RnGp>4 none Lin>4 none set36 ver44 ver11 21.3 3.9 7.2 10.4 21.8 23.8 23.9 1.4 4.6 0.0 24.2 27.1 24.2 0.0 3.6 27.1 3.6 0.0 This ends SubClus1 = 95 ver and vir samples only Lin>4 none Lin>4 none Lin>4 none Subc2.1 ver49 ver8 ver44 ver11
View full slide show More Sort Names ŌĆó Bubble sort ┬Ę Cocktail sort ┬Ę Odd-even sort ┬Ę Comb sort ┬Ę Gnome sort ┬Ę Quicksort ┬Ę Selection sort ┬Ę Heapsort ┬Ę Smoothsort ┬Ę Cartesian tree sort ┬Ę Tournament sort ┬Ę Cycle sort ┬Ę Insertion sort ┬Ę Shell sort ┬Ę Tree sort ┬Ę Library sort ┬Ę Patience sorting ┬Ę Monkey-puzzle sort ┬Ę Merge sort ┬Ę Polyphase merge sort ┬Ę Strand sort ┬Ę American flag sort ┬Ę Bead sort ┬Ę Bucket sort ┬Ę Burstsort ┬Ę Counting sort ┬Ę Pigeonhole sort ┬Ę Proxmap sort ┬Ę Radix sort ┬Ę Flashsort ┬Ę Bitonic sorter ┬Ę Batcher odd-even mergesort ┬Ę Timsort ┬Ę Introsort ┬Ę Spreadsort ┬Ę UnShuffle sort ┬Ę JSort ┬Ę Spaghetti sort ┬Ę Pancake sort
View full slide show d3 Sub 0 Clus1 1 Sub 0 Clus2 0 10 19 30 69 set23...50set+vir39 set25 ver49...50ver_49vir vir19 d5 (f5=vir23, g5=set14) none f5 none g5 none d5 (f5=vir32, g5=set14) none f5 none g5 none d5 (f5=vir6, g5=set14) none f5 none g5 none (d1+d3)/sqr(2) clus1 none (d1+d3)/sqr(2) clus2: ver49 ver8 ver44 ver11 0 57.3 ver49 0.0 3.9 3.9 7.2 0 58.0 ver8 3.9 0.0 1.4 4.6 0 58.7 ver44 3.9 1.4 0.0 3.6 1 60.1 ver11 7.2 4.6 3.6 0.0 0 64.3 ver10 none (d3+d4)/sqr(2) clus1 none (d3+d4)/sqr(2) clus2 none (d1+d3+d4)/sqr(3) clus1 1 44.5 set19 0 55.4 vir39 (d1+d3+d4)/sqr(3) clus2 none (d1+d2+d3+d4)/sqr(4) clus1 (d1+d2+d3+d4)/sqr(4) clus2 none d5 (f5=vir19, g5=set14) none f5 1 0.0 vir19 clus2 0 4.1 vir23 g5 none d5 (f5=vir18, g5=set14) none f5 1 0.0 vir18 clus2 1 4.1 vir32 0 8.2 vir6 g5 none
View full slide show Model Structure Tree Structure Specified for the Nested Logit Model Sample proportions are marginal, not conditional. Choices marked with * are excluded for the IIA test. ----------------+----------------+----------------+----------------+------+--Trunk (prop.)|Limb (prop.)|Branch (prop.)|Choice (prop.)|Weight|IIA ----------------+----------------+----------------+----------------+------+--Trunk{1} 1.00000|TRAVEL 1.00000|PRIVATE .55714|AIR .27619| 1.000| | | |CAR .28095| 1.000| | |PUBLIC .44286|TRAIN .30000| 1.000| | | |BUS .14286| 1.000| ----------------+----------------+----------------+----------------+------+--+---------------------------------------------------------------+ | Model Specification: Table entry is the attribute that | | multiplies the indicated parameter. | +--------+------+-----------------------------------------------+ | Choice |******| Parameter | | |Row 1| GC TTME INVT INVC A_AIR | | |Row 2| AIR_HIN1 A_TRAIN TRA_HIN3 A_BUS BUS_HIN4 | +--------+------+-----------------------------------------------+ |AIR | 1| GC TTME INVT INVC Constant | | | 2| HINC none none none none | |CAR | 1| GC TTME INVT INVC none | | | 2| none none none none none | |TRAIN | 1| GC TTME INVT INVC none | | | 2| none Constant HINC none none | |BUS | 1| GC TTME INVT INVC none | | | 2| none none none Constant HINC | +---------------------------------------------------------------+
View full slide show in[] sort.grid even.odd even.odd even.odd even.odd even.odd even.odd even.odd even.odd Mar 18, 2019 Copyright P.H.Welch out[] 75
View full slide show Entropyage (D)= 5/14 * -[0/5*log(0/5) + 5/5*log(5/5)] + 4/14 * -[2/4*log(2/4) + 2/4*log(2/4)] + 5/14 * -[3/5*log(3/5) + 2/5*log(2/5)] = .6324 bits Entropyincome (D)= 7/14 * -[2/7*log(2/7) + 5/7*log(5/7)] + 4/14 * -[2/4*log(2/4) + 2/4*log(2/4)] + 3/14 * -[1/3*log(1/3) + 2/3*log(2/3)] = .9140 bits Entropyveteran (D)= 3/14 * -[2/3*log(2/3) + 1/3*log(1/3)] + 11/14 * -[3/11*log(3/11) + 8/11*log(8/11)] = .8609 bits Entropycollege_educated (D)= 8/14 * -[6/8*log(6/8) + 2/8*log(2/8)] + 6/14 * -[3/6*log(3/6) + 3/6*log(3/6)] = .8921 bits
View full slide show Task 2: Implement the following sorting algorithms: selection sort, insertion sort, quick sort and merge sort, and compare them by real running time Requirements ŌĆó Find the running time as follows: check the current time t1; repeat the following steps 1000 times { randomly generate 10000 integers and save into array A; sort the integers in A using selection sort (or insertion sort, quick sort, merge sort); sort) } check the current time t2; running time of selection sort (or insertion sort, quick sort, merge sort) : = t2 ŌĆō t1; ŌĆó Implement the algorithms using C, C++, C#, or any other programming language. Submission Project description, Algorithms, Algorithm analysis, Experiment output, Code.
View full slide show Logarithms ŌĆó In algorithm analysis we often use the notation ŌĆ£log nŌĆØ without specifying the base Binary logarithm lg n ’ĆĮlog 2 n Natural logarithm ln n ’ĆĮlog e n log k n ’ĆĮ(log n ) k log log n ’ĆĮlog(log n ) log x y ’ĆĮ y log x log xy ’ĆĮ log x ’Ć½ log y x log ’ĆĮ log x ’ĆŁ log y y log a x ’ĆĮ log a b log b x CS 477/677 - Lecture 2 a logb x ’ĆĮ x logb a 4
View full slide show The Product Rule for Logs log 2 64 ’ĆĮlog 2 4 ’Ć½ log 2 16 ’ĆĮ2 ’Ć½ 4 ’ĆĮ6 log 2 14 ’ĆĮlog 2 (2 ’āŚ7) ’ĆĮlog 2 2 ’Ć½ log 2 7 ’ĆĮ1 ’Ć½ log 2 7 log 100 x ’ĆĮlog 100 ’Ć½ log x ’ĆĮ2 ’Ć½ log x log 5 125 yz ’ĆĮlog 5 125 ’Ć½ log 5 y ’Ć½ log 5 z9.4’ĆĮ3 ’Ć½ log 5 y ’Ć½ log 5 z 3
View full slide show Theorem: log(n!)’āÄ’üæ(nlogn) Case 1 nlogn ’āÄ O(log(n!)) log(n!) = log(n*(n-1)*(n-2) * * * 3*2*1) = log(n*(n-1)*(n-2)**n/2*(n/2-1)* * 2*1 => log(n/2*n/2* * * n/2*1 *1*1* * * 1) = log(n/2)n/2 = n/2 log n/2 ’āÄ O(nlogn) Case 2 log(n!) ’āÄ O(nlogn) log(n!) = logn + log(n-1) + log(n-2) + . . . Log(2) + log(1) < log n + log n + log n . . . + log n = nlogn
View full slide show Theorem: log(n!)’āÄ’üæ(nlogn) Case 1 nlogn ’āÄ O(log(n!)) log(n!) = log(n*(n-1)*(n-2) * * * 3*2*1) = log(n*(n-1)*(n-2)**n/2*(n/2-1)* * 2*1 => log(n/2*n/2* * * n/2*1 *1*1* * * 1) = log(n/2)n/2 = n/2 log n/2 ’āÄ O(nlogn) Case 2 log(n!) ’āÄ O(nlogn) log(n!) = logn + log(n-1) + log(n-2) + . . . Log(2) + log(1) < log n + log n + log n . . . + log n = nlogn
View full slide show Why Deep Learning? Different Classifiers on the MNIST Database Linear classifier Pairwise linear classifier None Deskewing Error rate (%) 7.6 K-Nearest Neighbors K-NN with non-linear deformation (P2DHMDM) None Shiftable edges 0.52 Boosted Stumps Product of stumps on Haar features None Haar features 0.87 Non-linear classifier 40 PCA + quadratic classifier None Support vector machine Virtual SVM, deg-9 poly, 2pixel jittered None Neural network 2-layer 784-800-10 None None Neural network 2-layer 784-800-10 elastic distortions None 1.6 0.7 Deep neural network 6-layer 784-2500-2000-15001000-500-10 elastic distortions None 0.35 Convolutional neural network 6-layer 784-40-80-500-10002000-10 None Expansion of the training data 0.31 Convolutional neural network 6-layer 784-50-100-500-100010-10 None Expansion of the training data 0.27 Convolutional neural network Committee of 35 CNNs, 1-20P-40-P-150-10 elastic distortions Width normalizations 0.23 Convolutional neural network Committee of 5 CNNs, 6-layer 784-50-100-500-1000-10-10 None Expansion of the training data 0.21 Distortion https://en.wikipedia.org/wiki/MNIST_database 9 Preprocessing None 3.3 0.56 Deskewing P Classifier DE E Type
View full slide show BEST Default Program Motor/Servo Port Joystick Channel Motor 2 (pair opposite of Motor 9) Motor Limits Positive Direction Negative Direction Stick 3 None None Motor 3 Stick 4 None None Motor 4 (pair opposite of Motor 7) Button 7 and 8 Up/Down/Left/Right None None Motor 5 Stick 1 Digital Input 1 Digital Input 2 Motor 6 Stick 2 Analog Input 1 Analog Input 1 Motor 7 (pair opposite of Motor 4) Button 7 and 8 Up/Down/Left/Right None None Motor 8 Button 6 Up None None Motor 9 (pair opposite of Motor 2) Stick 3 None None July, 2012 Copyright ┬® 2012 BEST Robotics, Inc. All rights reserved. 28
View full slide show ŌĆó Collecting memory usage In onCreate, add ŌĆō Context context = this.getApplicationContext(); ŌĆō ActivityManager mgr = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); ŌĆō List processes = mgr.getRunningAppProcesses(); ŌĆō Log.e("DEBUG", "Running processes:"); ŌĆō for(Iterator i = processes.iterator(); i.hasNext(); ) ŌĆō { ŌĆó RunningAppProcessInfo p = (RunningAppProcessInfo)i.next(); ŌĆó Log.e("DEBUG", " process name: "+p.processName); ŌĆó Log.e("DEBUG", " pid: "+p.pid); // process id ŌĆó int[] pids = new int; ŌĆó pids = p.pid; ŌĆó android.os.Debug.MemoryInfo[] MI = mgr.getProcessMemoryInfo(pids); ŌĆó Log.e("memory"," dalvik private: " + MI.dalvikPrivateDirty); ŌĆó Log.e("memory"," dalvik shared: " + MI.dalvikSharedDirty); ŌĆó Log.e("memory"," dalvik pss: " + MI.dalvikPss); ŌĆó Log.e("memory"," native private: " + MI.nativePrivateDirty); ŌĆó Log.e("memory"," native shared: " + MI.nativeSharedDirty); ŌĆó Log.e("memory"," native pss: " + MI.nativePss); ŌĆó Log.e("memory"," other private: " + MI.otherPrivateDirty); ŌĆó Log.e("memory"," other shared: " + MI.otherSharedDirty); ŌĆó Log.e("memory"," other pss: " + MI.otherPss); ŌĆó ŌĆó ŌĆó ŌĆó ŌĆó ŌĆō run } Log.e("memory"," Log.e("memory"," Log.e("memory"," total private dirty memory (KB): " + MI.getTotalPrivateDirty()); total shared (KB): " + MI.getTotalSharedDirty()); total pss: " + MI.getTotalPss());
View full slide show Redo Log Files ŌĆó Purpose: - store changes made to the database as a result of transaction and internal Oracle activities. ŌĆó Characteristics: 1. By default, an Oracle 10g database contains three redo log groups, REDO01.log, REDO02.log and REDO03.log 2. Every Oracle 10g database must have at least two redo log groups 3. The database will write log entries to a subsequent redo log group when the previous redo log group fills up 4. As a general rule , there should be one redo log group for approximately every four database users that create action queries 5. Oracle 10g keeps track of the Redo Log file by using a redo log sequence number, this number is recorded inside the file as they are used 6. The redo log sequence number is different than the operating system file name that is used to identify the physical file 7. If the database is in ARCHIVELOG mode full Redo Log files are copied to Archive Log files before they are reused, otherwise they are written over 8. Have a .log suffix CSE 781 ŌĆō Database Management Systems 17
View full slide show Katz Fractal Dimension Dimension = log(sum of lengths)/log(largest distance from the first point) double katz(double[] x) { int N = x.length; if (N<=1) return 0; ŌĆó L = Ōłæ xi ŌĆō xi-1 (sums adjacent lengths) ŌĆó max, min = from first point ŌĆó Katz normalizes log(L)/log(D)) to use log(L/d)/log(D/d) ŌĆó Final formula double L=0, diff=0, D=0; for (int i=1; i D) D = diff; log(N-1) / (log(D/m) + log(N-1)) } ŌĆó Notes double log = Math.log10(N-1); ŌĆō N-1 because there are N-1 intervals return (d==0)?0:log/(Math.log10(d/L) with a signal of N points +log); ŌĆō L / d = L / (L/(N-1)) = N-1 }
View full slide show KATZ FRACTAL DIMENSION Dimension = log(sum of lengths)/log(largest distance from the first point) double katz(double[] x) { int N = x.length; if (N<=1) return 0; L = Ōłæ xi ŌĆō xi-1 (sums adjacent lengths) ŌĆó max, min = from first point double L=0, diff=0, D=0; ŌĆó Katz normalizes log(L)/log(D)) to for (int i=1; i D) D = diff; log(N-1) / (log(D/m) + log(N-1)) } ŌĆó Notes double log = Math.log10(N-1); ŌĆō N-1 because there are N-1 intervals return (d==0)?0:log/ with a signal of N points (Math.log10(d/L)+log); ŌĆō L / d = L / (L/(N-1)) = N-1 }
View full slide show