FC2カウンター FPGAの部屋 白線追従走行用畳み込みニューラルネットワークの製作15(重みとバイアスのCヘッダファイル)

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。Xilinx ISEの初心者の方には、FPGAリテラシーおよびチュートリアルのページをお勧めいたします。

白線追従走行用畳み込みニューラルネットワークの製作15(重みとバイアスのCヘッダファイル)

白線追従走行用畳み込みニューラルネットワークの製作14(固定小数点用に量子化)”の続き。

前回は、畳み込みニューラルネットワークを固定小数点用に量子化し、Vivado HLS に使用する重みやバイアスのヘッダファイルを生成した。今回は、その結果生成できた重みとバイアスのCヘッダファイルを貼っておく。

畳み込み層の重みのファイル名は、conv1_weight.h、バイアスのファイル名は conv1_bias.h、1層目の全結合層のファイル名は af1_weight.h、バイアスのファイル名は af1_bias.h、2層目の全結合層の重みファイル名は af2_weight.h、バイアスのファイル名は af2_bias.h なので、そのファイルを貼っておく。

まずは、conv1_weight.h から貼っておく。

// conv1_weight.h
// 2017/08/24 20:29:30 by marsee

const float conv1_fweight[2][1][5][5] = 
{
    {
        {
            {0.294570413175,0.494004676217,0.44994119544,0.515573789799,0.544610330831},
            {0.40486488371,0.462682035597,0.45391988533,0.428258168527,0.380212999297},
            {0.50351358146,0.495029433364,0.498244962825,0.433375033151,0.377243668748},
            {0.503165711207,0.487963332866,0.444891841935,0.422814642144,0.401928034088},
            {0.411021574202,0.418571893201,0.487229387082,0.491190313386,0.499503929646}
        }
    }
    ,
    {
        {
            {0.00429091281128,-0.00429508065741,0.00521589342041,-0.00542417093149,0.0115336444712},
            {-0.00520812977283,-0.0125367789506,-0.0165218053161,-0.00583519826402,0.0021076978354},
            {0.0105605800117,-0.00306969245547,-0.0136611794413,-0.00504961598515,-0.0163449762107},
            {-0.0086441958247,-0.00414093021477,-0.00716074872487,-0.00832960908688,-0.000113451640109},
            {0.00463348666248,4.79973508012e-05,0.0139718435768,0.000123781195982,0.0105360722489}
        }
    }
};

const ap_fixed<91, AP_TRN_ZERO, AP_SAT> conv1_weight[2][1][5][5] = 
{
    {
        {
            {0.29296875,0.4921875,0.44921875,0.515625,0.54296875},
            {0.40625,0.4609375,0.453125,0.4296875,0.37890625},
            {0.50390625,0.49609375,0.5,0.43359375,0.37890625},
            {0.50390625,0.48828125,0.4453125,0.421875,0.40234375},
            {0.41015625,0.41796875,0.48828125,0.4921875,0.5}
        }
    }
    ,
    {
        {
            {0.00390625,0.0,0.00390625,0.0,0.01171875},
            {0.0,-0.0078125,-0.01171875,0.0,0.00390625},
            {0.01171875,0.0,-0.0078125,0.0,-0.01171875},
            {-0.00390625,0.0,-0.00390625,-0.00390625,0.0},
            {0.00390625,0.0,0.015625,0.0,0.01171875}
        }
    }
};


次に conv1_bias.h を貼っておく。

// conv1_bias.h
// 2017/08/24 20:29:33 by marsee

const float conv1_fbias[2] = {
    -0.4674033430470.0
};

const ap_fixed<91, AP_TRN_ZERO, AP_SAT> conv1_bias[2] = {
    -0.464843750.0
};


af1_weight.h は長すぎて貼るのが無理でした。431KB

af1_bias.h を貼っておく。

// af1_bias.h
// 2017/08/24 20:29:35 by marsee

const float af1_fbias[100] = {
    -0.00538524705766, -0.00598539062265, -0.005655360481320.0, -0.00685936102353, -0.00536698581278, -0.00623459442338, -0.007093949590530.00.158105182373, -0.034250223689, -0.001245154527190.00.1562606357060.02580014942180.08448134373350.0882019232825, -0.07031338233150.0, -0.00528064880736, -0.00423357775603, -0.005996020187080.0741511844097, -0.140380278179, -0.00802484293904, -0.005949261564750.160366829792, -0.00598124395411, -0.005816919651270.0, -0.00433641008826, -0.0581982793318, -0.005948405029840.0, -0.00596392388605, -0.0345905812002, -0.005967000139070.0, -0.005664658350730.0, -0.005433420538680.1067995767210.0416939154099, -0.08776094553340.0572610067402, -0.00588865216287, -0.00598300886618, -0.1190247442370.08514403099570.12963722794, -0.00806675185856, -0.004345842795750.1098254019310.00.0422327145024, -0.005924856338980.0534250925738, -0.0559710722051, -0.00535198913464, -0.0059733490076, -0.0861017024054, -0.005880278057920.004592889931980.0, -0.005915456495150.0897744436782, -0.0059229789071, -0.072504495188, -0.00523629719031, -0.00491575729656, -0.1018396397450.15618643854, -0.00562686983234, -0.00595156113069, -0.00532042799961, -0.005935448414090.0, -0.145186356158, -0.005973354147620.0, -0.007385094132140.0868084556983, -0.00487009622847, -0.00590424120649, -0.00751997670017, -0.1425211097990.0, -0.0969972486866, -0.105567556471, -0.005952902673020.0264242303548, -0.13445683226, -0.007476007473750.00.00.0, -0.00597598643903, -0.1527062520340.0, -0.0660025441402
};

const ap_fixed<91, AP_TRN_ZERO, AP_SAT> af1_bias[100] = {
    0.0, -0.003906250.00.0, -0.003906250.0, -0.00390625, -0.003906250.00.15625, -0.031250.00.00.156250.027343750.08593750.08984375, -0.066406250.00.00.0, -0.003906250.07421875, -0.13671875, -0.00390625, -0.003906250.16015625, -0.003906250.00.00.0, -0.0546875, -0.003906250.0, -0.00390625, -0.03125, -0.003906250.00.00.00.00.105468750.04296875, -0.082031250.05859375, -0.00390625, -0.00390625, -0.113281250.08593750.12890625, -0.003906250.00.1093750.00.04296875, -0.003906250.0546875, -0.050781250.0, -0.00390625, -0.08203125, -0.003906250.003906250.0, -0.003906250.08984375, -0.00390625, -0.07031250.00.0, -0.097656250.156250.0, -0.003906250.0, -0.003906250.0, -0.140625, -0.003906250.0, -0.003906250.08593750.0, -0.00390625, -0.00390625, -0.136718750.0, -0.09375, -0.1015625, -0.003906250.02734375, -0.12890625, -0.003906250.00.00.0, -0.00390625, -0.14843750.0, -0.0625
};



af2_weight.h を貼っておく。

// af2_weight.h
// 2017/08/24 20:29:38 by marsee

const float af2_fweight[100][3] = {
    {-0.008203559709570.00101259251505, -0.00738029792378},
    {-0.00658775205594, -0.00486606234669, -0.0093604152744},
    {-0.00376509576185, -0.003204181568390.00446600986062},
    {-0.00222591145973, -0.0114764282693, -0.0125846717219},
    {-0.0172525876603, -0.0121569822688, -0.0174832203182},
    {-0.004441212470930.003766606703720.00494277572638},
    {0.01441663415110.00571422646049, -0.000451331284046},
    {-0.00773734700282, -0.0127894700042, -0.00316662283778},
    {-0.009803203114970.007741444493320.00466787755531},
    {-0.153223966440.008320433918830.201276629574},
    {-0.06730212004620.090204938319, -0.112073644712},
    {0.002983074645430.006441572451560.00800343766018},
    {-0.00952199361278, -0.00483905084921, -0.0150083862732},
    {-0.100111162346, -0.06674189210180.168230912865},
    {-0.4343895318170.1227618683880.112380800074},
    {-0.1855565389570.117074098232, -0.00454780154485},
    {-0.2081309278940.1281486351270.00580676863725},
    {0.005362935276610.110961879853, -0.200961349249},
    {0.01791324829750.000113803245086, -0.0179738854863},
    {0.00785219154510.004908871626680.00664359090093},
    {0.00279295320522, -0.01178098163320.0233511027877},
    {0.00576400892566, -0.001547139699620.00780394968406},
    {0.0326806385735, -0.1162723607440.104181499231},
    {0.281688127519, -0.050505987361, -0.337821332905},
    {0.004127154572620.005281699452680.00765624887698},
    {-0.000676362650949, -0.006215883624890.0114413980656},
    {-0.152045040818, -0.01977974394750.176308752788},
    {-0.00101985599932, -0.007261180072, -0.00405065562585},
    {-0.01094827778950.002965088469560.00209693843146},
    {-0.00941176993216, -0.01503386398020.0146204542805},
    {0.01087650005030.00221551292604, -0.00943386328304},
    {0.273536715663, -0.439966649596, -0.0483120039363},
    {0.0006413858995790.00176874518582, -0.00283284521959},
    {-0.0114604863243, -0.00768064077955, -0.0105853713444},
    {0.00367602592519, -0.0201054399855, -0.00727753876315},
    {0.130101479837, -0.1284144361010.0249145199096},
    {-0.0008233418872560.01013374819580.00650373443506},
    {-0.00943068902902, -0.00153673986995, -0.00636511125021},
    {0.00756524681284, -0.0009571464814340.00279509536095},
    {-0.0101610421199, -0.01216890947420.00611739537186},
    {0.00277517408640.000687300479967, -0.00142426431398},
    {0.0107963370449, -0.09615631988480.135769397739},
    {0.067479675116, -0.1186809214620.101454270851},
    {0.278649405523, -0.0638102974619, -0.405159676297},
    {-0.1592821761710.120383212282, -0.0300551862799},
    {0.01361898882630.005921762121310.00672759183286},
    {0.01378185597940.01638733933780.00642866861232},
    {0.282523857349, -0.087944438418, -0.238954778183},
    {-0.1902559477020.1455796083590.0075601932195},
    {-0.0315043857812, -0.0836230003090.136702205578},
    {0.0006080333066840.009138864574740.0102832249771},
    {0.005376887515250.01331613466860.00610052322048},
    {-0.2346635518930.1242749544210.0563793991797},
    {0.00587731057438, -0.01586642376820.0284369610688},
    {-0.5436411636250.1300273652450.157524888611},
    {-0.00774212606919, -0.004508433329550.0189166493825},
    {0.0646963727477, -0.108050316130.108404665099},
    {-0.02679235716380.108829036939, -0.121159157504},
    {-0.01840221784860.01698156401080.0154621580396},
    {0.002903019899980.004391103052820.0129160123658},
    {0.295774852423, -0.0564873278638, -0.537593080117},
    {-0.001173046500410.01061915672210.00614773011635},
    {0.00185660062042, -0.00336154769079, -0.00131980922298},
    {0.000711758901132, -0.01694977341510.00983303319272},
    {0.01164804300040.005215837887650.0111912428732},
    {-0.193370068720.1126671727990.004643172569},
    {0.005388462972190.00584099064517, -0.00176371930271},
    {-0.02705904588830.111207364222, -0.13031455024},
    {-0.006397787438060.01674665004880.00998962984116},
    {-0.01242906819650.000692885600751, -0.00959108577132},
    {0.388707026472, -0.490774843687, -0.113918271156},
    {-0.160369252488, -0.0007911600186290.170142601415},
    {0.003277902993050.0129578276680.0128847095396},
    {0.00131031872257, -0.000112629890535, -0.00291128770448},
    {0.101561554831, -0.1105221962340.063784932396},
    {-0.00458738838876, -0.00859014309809, -0.00576967017053},
    {0.005945564559320.005687003579970.00436139354229},
    {0.2775377640750.0147263855709, -0.325946679767},
    {0.002813758619340.006832184890340.00312772971751},
    {-0.01896927253350.0069368813551, -0.000677285718001},
    {0.00786093523784, -0.000952448132357, -0.013087215922},
    {0.0424404088819, -0.11092709470.13765443958},
    {0.00663733102854, -0.01224060891120.00238680007741},
    {0.003353839903730.01164740585890.01331781551},
    {0.00631725835386, -0.0058431887138, -0.00040914131858},
    {0.308370395049, -0.0440874511783, -0.366299602116},
    {-0.01493625828150.00446126933178, -0.000938738496254},
    {0.184354359182, -0.0904720145049, -0.0866392911745},
    {0.193741093433, -0.0876960948411, -0.113986496103},
    {-0.0249647325112, -0.005942802957460.01038246304},
    {0.0850977285604, -0.1155158919770.0909139518915},
    {0.260905844821, -0.0841269913801, -0.317866350456},
    {-0.00097223996393, -0.0046818354073, -0.00443646653402},
    {-0.003641754549290.0139558811565, -0.00771410003344},
    {-0.00216841359756, -0.00545245263308, -0.00386304728375},
    {-8.70602913003e-050.01114317405640.0145401735664},
    {-0.00963447070917, -0.007782269608090.00101368004201},
    {0.2506791106410.0187397414502, -0.326182991553},
    {-0.01398419460770.007116482017950.0103306514814},
    {0.18164313447, -0.133722739697, -0.00864408506204}
};

const ap_fixed<91, AP_TRN_ZERO, AP_SAT> af2_weight[100][3] = {
    {-0.003906250.0, -0.00390625},
    {-0.003906250.0, -0.00390625},
    {0.00.00.00390625},
    {0.0, -0.0078125, -0.0078125},
    {-0.01171875, -0.0078125, -0.01171875},
    {0.00.003906250.00390625},
    {0.0156250.003906250.0},
    {-0.00390625, -0.00781250.0},
    {-0.00781250.00781250.00390625},
    {-0.14843750.00781250.203125},
    {-0.06250.08984375, -0.109375},
    {0.003906250.00781250.0078125},
    {-0.003906250.0, -0.01171875},
    {-0.09765625, -0.06250.16796875},
    {-0.42968750.121093750.11328125},
    {-0.183593750.11718750.0},
    {-0.2031250.128906250.00390625},
    {0.003906250.109375, -0.1953125},
    {0.019531250.0, -0.015625},
    {0.00781250.003906250.0078125},
    {0.00390625, -0.00781250.0234375},
    {0.003906250.00.0078125},
    {0.03125, -0.113281250.10546875},
    {0.28125, -0.046875, -0.33203125},
    {0.003906250.003906250.0078125},
    {0.0, -0.003906250.01171875},
    {-0.1484375, -0.0156250.17578125},
    {0.0, -0.003906250.0},
    {-0.00781250.003906250.00390625},
    {-0.00390625, -0.011718750.015625},
    {0.011718750.00390625, -0.00390625},
    {0.2734375, -0.4375, -0.04296875},
    {0.00.00.0},
    {-0.0078125, -0.00390625, -0.0078125},
    {0.00390625, -0.015625, -0.00390625},
    {0.12890625, -0.1250.0234375},
    {0.00.011718750.0078125},
    {-0.003906250.0, -0.00390625},
    {0.00781250.00.00390625},
    {-0.0078125, -0.00781250.0078125},
    {0.003906250.00.0},
    {0.01171875, -0.093750.13671875},
    {0.06640625, -0.113281250.1015625},
    {0.27734375, -0.05859375, -0.40234375},
    {-0.156250.12109375, -0.02734375},
    {0.011718750.00781250.0078125},
    {0.0156250.0156250.0078125},
    {0.28125, -0.0859375, -0.234375},
    {-0.18750.144531250.0078125},
    {-0.02734375, -0.0781250.13671875},
    {0.00.00781250.01171875},
    {0.003906250.011718750.0078125},
    {-0.230468750.1250.0546875},
    {0.0078125, -0.011718750.02734375},
    {-0.53906250.128906250.15625},
    {-0.003906250.00.01953125},
    {0.06640625, -0.105468750.109375},
    {-0.02343750.109375, -0.1171875},
    {-0.0156250.0156250.015625},
    {0.003906250.003906250.01171875},
    {0.296875, -0.05078125, -0.53515625},
    {0.00.011718750.0078125},
    {0.00.00.0},
    {0.0, -0.011718750.01171875},
    {0.011718750.003906250.01171875},
    {-0.191406250.113281250.00390625},
    {0.003906250.003906250.0},
    {-0.02343750.109375, -0.125},
    {-0.003906250.0156250.01171875},
    {-0.00781250.0, -0.00390625},
    {0.390625, -0.48828125, -0.109375},
    {-0.156250.00.171875},
    {0.003906250.011718750.01171875},
    {0.00.00.0},
    {0.1015625, -0.105468750.0625},
    {0.0, -0.003906250.0},
    {0.00781250.003906250.00390625},
    {0.277343750.015625, -0.3203125},
    {0.003906250.00781250.00390625},
    {-0.0156250.00781250.0},
    {0.00781250.0, -0.0078125},
    {0.04296875, -0.105468750.13671875},
    {0.0078125, -0.00781250.00390625},
    {0.003906250.011718750.01171875},
    {0.00781250.00.0},
    {0.30859375, -0.0390625, -0.36328125},
    {-0.011718750.003906250.0},
    {0.18359375, -0.0859375, -0.08203125},
    {0.1953125, -0.08203125, -0.109375},
    {-0.01953125, -0.003906250.01171875},
    {0.0859375, -0.113281250.08984375},
    {0.26171875, -0.08203125, -0.3125},
    {0.00.00.0},
    {0.00.015625, -0.00390625},
    {0.00.00.0},
    {0.00.011718750.015625},
    {-0.00390625, -0.003906250.0},
    {0.250.01953125, -0.32421875},
    {-0.011718750.00781250.01171875},
    {0.18359375, -0.12890625, -0.00390625}
};


af2_bias.h を貼っておく。

// af2_bias.h
// 2017/08/24 20:29:35 by marsee

const float af2_fbias[3] = {
    -0.0999304880919, -0.02879082868040.121076044953
};

const ap_fixed<91, AP_TRN_ZERO, AP_SAT> af2_bias[3] = {
    -0.09765625, -0.02343750.12109375
};


残念ながら、 af1_weight.h が長すぎて貼れなかった。。。
  1. 2017年08月25日 04:31 |
  2. DNN
  3. | トラックバック:0
  4. | コメント:0

コメント

コメントの投稿


管理者にだけ表示を許可する

トラックバック URL
http://marsee101.blog19.fc2.com/tb.php/3895-b04a030e
この記事にトラックバックする(FC2ブログユーザー)