Changeset e0350e0 for doc/theses/mike_brooks_MMath/plots/string-allocn.py
- Timestamp:
- Jun 4, 2025, 1:43:34 PM (4 months ago)
- Branches:
- master
- Children:
- f858ca5
- Parents:
- c8bdbaf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/plots/string-allocn.py
rc8bdbaf re0350e0 31 31 100:[-1.0, 0.1, 0.2, 0.5, 0.9], 32 32 200:[-1.0, 0.1, 0.2, 0.5, 0.9], 33 500:[-1.0, 0. 4, 0.9, 0.98]}33 500:[-1.0, 0.2, 0.4, 0.9, 0.98]} 34 34 35 35 defaultExpansions = [-1, 0.2] … … 56 56 ) 57 57 58 combined['is-default'] = np.isin(combined['expansion'], defaultExpansions).astype(int) 58 combined = combined.pivot_table( values=['op-duration-ns','hw_cur_req_mem(B)'], index=['corpus-meanlen-tgt', 'sut-platform', 'expansion'], aggfunc=['mean', 'min', 'max'] ) 59 combined = combined.reset_index() 60 combined.columns = combined.columns.to_flat_index() 61 62 # text = combined.to_csv(header=True, index=True, sep='\t') 63 # print(text) 64 65 66 combined['is-default'] = np.isin(combined[('expansion','')], defaultExpansions).astype(int) 67 68 59 69 60 70 # print ('!!') … … 66 76 # First, for the CFA curves 67 77 sut = "cfa" 68 sutGroup = combined.groupby( 'sut-platform').get_group(sut)78 sutGroup = combined.groupby(('sut-platform','')).get_group(sut) 69 79 70 groupedSize = sutGroup.groupby( 'corpus-meanlen')80 groupedSize = sutGroup.groupby(('corpus-meanlen-tgt','')) 71 81 72 82 for sz, szgroup in groupedSize: 73 83 74 84 if sz in favSizes.keys(): 75 szgroup_sorted = szgroup.sort_values(by= 'expansion')85 szgroup_sorted = szgroup.sort_values(by=('expansion','')) 76 86 77 87 print('"{sut}, len={len}"'.format(sut=sut, len=sz)) 78 88 # print(szgroup_sorted) ## 79 89 # print(szgroup_sorted['expansion'], 'isin', favSizes[sz]) ## 80 favoured = szgroup_sorted.loc[szgroup_sorted[ 'expansion'].isin(favSizes[sz])]90 favoured = szgroup_sorted.loc[szgroup_sorted[('expansion','')].isin(favSizes[sz])] 81 91 # print('!') ## 82 92 # print(favoured) ## 83 text = favoured[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'is-default']].to_csv(header=False, index=False, sep='\t') 93 text = favoured[[('expansion',''), 94 ('mean','op-duration-ns'), 95 ('min','op-duration-ns'), 96 ('max','op-duration-ns'), 97 ('mean', 'hw_cur_req_mem(B)'), 98 ('min', 'hw_cur_req_mem(B)'), 99 ('max', 'hw_cur_req_mem(B)'), 100 'is-default']].to_csv(header=False, index=False, sep='\t') 84 101 print(text) 85 102 print() … … 89 106 atDefaults = combined.groupby('is-default').get_group(1) 90 107 91 for sz, szgroup in atDefaults.groupby( 'corpus-meanlen'):108 for sz, szgroup in atDefaults.groupby(('corpus-meanlen-tgt','')): 92 109 93 110 if sz in favSizes.keys(): 94 111 print(sz) 95 text = szgroup[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'sut-platform']].to_csv(header=False, index=False, sep='\t') 112 text = szgroup[[('expansion',''), 113 ('mean','op-duration-ns'), 114 ('min','op-duration-ns'), 115 ('max','op-duration-ns'), 116 ('mean', 'hw_cur_req_mem(B)'), 117 ('min', 'hw_cur_req_mem(B)'), 118 ('max', 'hw_cur_req_mem(B)'), 119 ('sut-platform','')]].to_csv(header=False, index=False, sep='\t') 96 120 print(text) 97 121 print()
Note:
See TracChangeset
for help on using the changeset viewer.