Commit 256aeed9 authored by Martin Řepa's avatar Martin Řepa

Successfully migrated to pytorch. Working loss func

parent 78bdbab5
{
"_meta": {
"hash": {
"sha256": "2c866e2015b7b2d117cd225cc947930fe78ffb18d8ce9ec0dbc6c23646c2ddb2"
"sha256": "7d6b47e2ff2ba43cd8f50922d385f306e1876ba3f4a3e67e3c74c60ee152787f"
},
"pipfile-spec": 6,
"requires": {
......@@ -60,36 +60,40 @@
},
"grpcio": {
"hashes": [
"sha256:0134bab8e8d16b195547f9216517b3abcd3e4b6b1f5a1c8940099888003287ac",
"sha256:084d4a5f34a671bd0ec4668d3a7a3351015de81e6d4aef6710d9dab026def8cc",
"sha256:1ab29724526d8651c8b878257775e17cf3fba7474c01edc76ff8bcfecf570f91",
"sha256:1bd017ca22a126af0d7d67b4140b427ae58fd6d79dbd277e6f21be3ee0fdfef7",
"sha256:25e7b619973e20d8f2cf05d6af0f2e11263a8792b99c058a5b590ef7aef554b8",
"sha256:2e836e6092e6639cc9edb486f27c6fe078408aac54ed345c5762edcf8588d9c2",
"sha256:34870eb5d157fe9639f263f0bfe0bcdc1737a6c08181ce113585f6461f37c84b",
"sha256:424c8f0748935932d28531ce6d817a11914dfb385b86fe815297f122cd04d592",
"sha256:43c42570f769748982c61a249e01eec5f91149e2aa98438c893de64e649d562b",
"sha256:4f845d13ecff25012fc9c7f22067fca1d2b3da3f693da146ddcc587fdab3e7b4",
"sha256:614de7d6672eb023c08dde70b103efa9faacf86ac63b2a24f8d74b064a86f6f0",
"sha256:6c5956292692f385bb12b5f47afd70ae9469d2ee07a949c94aef2946020c1300",
"sha256:7030674682433a5cbc069cd5a5fbcdf193c8a3680dc161cd7b984f72ab609f23",
"sha256:77fff21bee2d3c3487891cdb69b35190deddac609e48c05262e1097f0b2cd82a",
"sha256:8ac64f3e17e6a13abf9628f0ba22012c948d7ab400592510fed3c62444bdcc0d",
"sha256:8fdfa8129e1ab2cdf053956dd07b21ccc127c8a8f0c5b83ff60987c009ddb636",
"sha256:8ff4935abf61206479dd42c56aba0f6c395aebb5c42b29b1f7c2faae41ad979c",
"sha256:9af47d0f4137a2951b73ee592bdc5690b242cfe81cdfacba1b34becbf72a0d59",
"sha256:9da5b3c883621afca008d2c5729ddd7f06153f5dcaae1f690bead9b9018a3594",
"sha256:abe825aa49e6239d5edf4e222c44170d2c7f6f4b1fd5286b4756a62d8067e112",
"sha256:c8330efa27af2b65aa556a66517ba6657a13e259670ad32dec1b6ff3d6616c3c",
"sha256:dc3d09abe7b49e84516b53920320d0f0d05587f6398431e50d6a47bd7d27a8b6",
"sha256:deb08edefef880609f8bd2945764f31d577785ff3f2daea7027b67432ff12f74",
"sha256:e019c86f55cdcd2bbc239beab14167f2e03ee92407c7c42ddf42edf6f5640cce",
"sha256:eb0d154c4749458353fbb5a55b39de7aa8445617c20d200729f924be125c56d0",
"sha256:eed5edb8f2620ad1157c8c5786809fb0a2d885969287a758752ce514274e3be0",
"sha256:f7a9fc2dfbbc0e838c79f908262638fb86ab326b0fbc0ea2c3dd063b3561e9e2",
"sha256:f9df2e626f1a8d8114a9dc05a489bdf26a8e926fbbe43112669700f25fe0abb3"
],
"version": "==1.18.0"
"sha256:07c7f7b251b26ef94e29d2c19245e34d4d05897325a289b31de3b6a5e16fbd6c",
"sha256:2ddbca16c2e7b3f2ffc6e34c7cfa6886fb01de9f156ad3f77b72ad652d632097",
"sha256:30d84f9684b4c81ee37906bb303a84435948c2dd3db55d3ef38f8daf28bc6ea3",
"sha256:316e6c79fb1585b23ae100ee26f6ffefa91a21e4d39588fa42efadd7f20c7225",
"sha256:400abff9a772351fff72d5698c8758b837bec3d7f4ed93de70bae744d8f63f53",
"sha256:4ed90a256f6f8690b5c95b9d4f2e9fe6513628f3674e9068e10637e50c2f93d6",
"sha256:51fd87ff610ca2f483c668c3fa7f70d479bffb3c14805d2065b51194edea5e26",
"sha256:5569aba69041530e04eff3d40536027db8851f4e11e6282849b9fc5b1855075d",
"sha256:566b752e36cdcd5a4d38f292aca4c8e3095f13cfe82606e010d67749cacba341",
"sha256:5817f970fbfed72a6203ff96349e796d8f6ff3ce85b58af241c4a14190d9f4d1",
"sha256:5a97bb5a4af16f840f1211dbe66d61592f02110f286d96e67bf6006d7f96aab7",
"sha256:5d57e41c913152b215eda070955b3544bdf20ed2327e5e5eed3005186220ebd0",
"sha256:6cec17145978cef3d20093cdc05e88da597ce05076db566a66a35b9c55d416a3",
"sha256:6ef7ab9b6ba09ce087ddb3b27f12504f50efdbf5d319b8b23173478765452301",
"sha256:756c0d65e4ebce1c47787dbb48955864f2a768e1df76902f33d3e4062c209f3e",
"sha256:828d13f0edd27f452af7fc23093c8a2d63d8fbd92595dbd0f698c78b13af9bdb",
"sha256:8cf02c4e07520be61ad8b59b0043771ef2af666cb73066516eabfee562a28df4",
"sha256:919dfe84d22ce2e2ae81d82238586d7c2a86714fb0b6cf9b437e336851e3c32d",
"sha256:b04a061280b06cdc4e68c4147a0f46b98c395cf62f0c6df4fa2a30a083cdc333",
"sha256:b2dbe7d2f9685bdbb4415f8e475dd96b1b1776193b7286705f90490c3f039037",
"sha256:b60df7cbc3e77c39d5befe6a1e6e4213f3ca683d743ff7c1622b1d4412245a55",
"sha256:b740681332b5a042b9e22246a3cdbfc3d644cf73d38e117f20ad9d8deab8f1a5",
"sha256:ba434873945d5d4542589674cb60c43a1cf76b2b5f0c0f759aa76d499055722f",
"sha256:bcb44cd53beccc92c730254ad3d50715b67a7432e693961b566d982f759b1787",
"sha256:be1cbb6cad1d4242e3aaa4143eabcfbf383358f6c8e9951be2c497b65561b075",
"sha256:c4e38326fcab5c52fd1a8c8e0f908bfe830629a5ffc60793ec5545ef913d62d2",
"sha256:d03c0524d5953568f74269e0faebb1e880ba9f36ca8c773be397087c35bd8188",
"sha256:ea897ffa80276565acdd92349ef82a768db0e3327aacd4aec82f79ca10989689",
"sha256:edc50e8bcd10b165f34c3cf3e1d4f97e9c71b165b85a85b91cf3444000a17692",
"sha256:f96a2e97df522b50da9cb3795f08199b110ceab4146bf70ea7f6a3a0213786cc",
"sha256:fadb649a69e3b08e01f090c24f0c8cccc122e92c362c1a1727b695a63be8416b",
"sha256:fbe4360ff1689a9753cbf1b27dad11e683d39117a32a64372a7c95c6abc81b81"
],
"version": "==1.19.0"
},
"h5py": {
"hashes": [
......@@ -133,10 +137,10 @@
},
"keras-preprocessing": {
"hashes": [
"sha256:6e669aa713727f0bc08f756616f64e0dfa75d822226cfc0dcf33297ab05cef7d",
"sha256:c0cbc80c0cd2d9052afd4977a29ed3a8d12e8d131adfde9db62134c0d48c48c0"
"sha256:0170b799a7562f80ad7931d22d56de22cf4bdd502e11c48f31a46380137a70a8",
"sha256:5e3700117981c2db762e512ed6586638124fac5842170701628088a11aeb51ac"
],
"version": "==1.0.8"
"version": "==1.0.9"
},
"kiwisolver": {
"hashes": [
......@@ -197,60 +201,74 @@
"index": "pypi",
"version": "==3.0.2"
},
"mock": {
"hashes": [
"sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1",
"sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba"
],
"version": "==2.0.0"
},
"numpy": {
"hashes": [
"sha256:0cdbbaa30ae69281b18dd995d3079c4e552ad6d5426977f66b9a2a95f11f552a",
"sha256:2b0cca1049bd39d1879fa4d598624cafe82d35529c72de1b3d528d68031cdd95",
"sha256:31d3fe5b673e99d33d70cfee2ea8fe8dccd60f265c3ed990873a88647e3dd288",
"sha256:34dd4922aab246c39bf5df03ca653d6265e65971deca6784c956bf356bca6197",
"sha256:384e2dfa03da7c8d54f8f934f61b6a5e4e1ebb56a65b287567629d6c14578003",
"sha256:392e2ea22b41a22c0289a88053204b616181288162ba78e6823e1760309d5277",
"sha256:4341a39fc085f31a583be505eabf00e17c619b469fef78dc7e8241385bfddaa4",
"sha256:45080f065dcaa573ebecbfe13cdd86e8c0a68c4e999aa06bd365374ea7137706",
"sha256:485cb1eb4c9962f4cd042fed9424482ec1d83fee5dc2ef3f2552ac47852cb259",
"sha256:575cefd28d3e0da85b0864506ae26b06483ee4a906e308be5a7ad11083f9d757",
"sha256:62784b35df7de7ca4d0d81c5b6af5983f48c5cdef32fc3635b445674e56e3266",
"sha256:69c152f7c11bf3b4fc11bc4cc62eb0334371c0db6844ebace43b7c815b602805",
"sha256:6ccfdcefd287f252cf1ea7a3f1656070da330c4a5658e43ad223269165cdf977",
"sha256:7298fbd73c0b3eff1d53dc9b9bdb7add8797bb55eeee38c8ccd7906755ba28af",
"sha256:79463d918d1bf3aeb9186e3df17ddb0baca443f41371df422f99ee94f4f2bbfe",
"sha256:8bbee788d82c0ac656536de70e817af09b7694f5326b0ef08e5c1014fcb96bb3",
"sha256:a863957192855c4c57f60a75a1ac06ce5362ad18506d362dd807e194b4baf3ce",
"sha256:ae602ba425fb2b074e16d125cdce4f0194903da935b2e7fe284ebecca6d92e76",
"sha256:b13faa258b20fa66d29011f99fdf498641ca74a0a6d9266bc27d83c70fea4a6a",
"sha256:c2c39d69266621dd7464e2bb740d6eb5abc64ddc339cc97aa669f3bb4d75c103",
"sha256:e9c88f173d31909d881a60f08a8494e63f1aff2a4052476b24d4f50e82c47e24",
"sha256:f1a29267ac29fff0913de0f11f3a9edfcd3f39595f467026c29376fad243ebe3",
"sha256:f69dde0c5a137d887676a8129373e44366055cf19d1b434e853310c7a1e68f93"
"sha256:1980f8d84548d74921685f68096911585fee393975f53797614b34d4f409b6da",
"sha256:22752cd809272671b273bb86df0f505f505a12368a3a5fc0aa811c7ece4dfd5c",
"sha256:23cc40313036cffd5d1873ef3ce2e949bdee0646c5d6f375bf7ee4f368db2511",
"sha256:2b0b118ff547fecabc247a2668f48f48b3b1f7d63676ebc5be7352a5fd9e85a5",
"sha256:3a0bd1edf64f6a911427b608a894111f9fcdb25284f724016f34a84c9a3a6ea9",
"sha256:3f25f6c7b0d000017e5ac55977a3999b0b1a74491eacb3c1aa716f0e01f6dcd1",
"sha256:4061c79ac2230594a7419151028e808239450e676c39e58302ad296232e3c2e8",
"sha256:560ceaa24f971ab37dede7ba030fc5d8fa173305d94365f814d9523ffd5d5916",
"sha256:62be044cd58da2a947b7e7b2252a10b42920df9520fc3d39f5c4c70d5460b8ba",
"sha256:6c692e3879dde0b67a9dc78f9bfb6f61c666b4562fd8619632d7043fb5b691b0",
"sha256:6f65e37b5a331df950ef6ff03bd4136b3c0bbcf44d4b8e99135d68a537711b5a",
"sha256:7a78cc4ddb253a55971115f8320a7ce28fd23a065fc33166d601f51760eecfa9",
"sha256:80a41edf64a3626e729a62df7dd278474fc1726836552b67a8c6396fd7e86760",
"sha256:893f4d75255f25a7b8516feb5766c6b63c54780323b9bd4bc51cdd7efc943c73",
"sha256:972ea92f9c1b54cc1c1a3d8508e326c0114aaf0f34996772a30f3f52b73b942f",
"sha256:9f1d4865436f794accdabadc57a8395bd3faa755449b4f65b88b7df65ae05f89",
"sha256:9f4cd7832b35e736b739be03b55875706c8c3e5fe334a06210f1a61e5c2c8ca5",
"sha256:adab43bf657488300d3aeeb8030d7f024fcc86e3a9b8848741ea2ea903e56610",
"sha256:bd2834d496ba9b1bdda3a6cf3de4dc0d4a0e7be306335940402ec95132ad063d",
"sha256:d20c0360940f30003a23c0adae2fe50a0a04f3e48dc05c298493b51fd6280197",
"sha256:d3b3ed87061d2314ff3659bb73896e622252da52558f2380f12c421fbdee3d89",
"sha256:dc235bf29a406dfda5790d01b998a1c01d7d37f449128c0b1b7d1c89a84fae8b",
"sha256:fb3c83554f39f48f3fa3123b9c24aecf681b1c289f9334f8215c1d3c8e2f6e5b"
],
"index": "pypi",
"version": "==1.16.1"
"version": "==1.16.2"
},
"pandas": {
"hashes": [
"sha256:02d34a55e85819a7eab096f391f8dcc237876e8b3cdaf1fba964f5fb59af9acf",
"sha256:0dbcf78e68f619840184ce661c68c1760de403b0f69d81905d6b9a699d1861d6",
"sha256:174c3974da26fd778ac8537d74efb17d4cef59e6b3e81e3c59690f39a6f6b73d",
"sha256:3a8ab5c350131ba273d3f8eb430343304d6c2138a61d34e4a11ebd75f8bf3e7e",
"sha256:560074ce9ff95409b233c0a8d143a2546a2d71d636d583172252dc0021fdb11b",
"sha256:5bded8cb431705609dbd9048114f1d6d59bef2f1ca95a8c58bd649442c9dc16c",
"sha256:8a8748684787792f3a643a7e0530c3024301f3e5799a199a5c2c526c07f712ba",
"sha256:8c7e43c4b7920fc02ce7743b976aca15bd45293ed298d84793307bc9799df3f6",
"sha256:9bd9ef3e183b7b1ce90b7ab5e8672907cd73dc36f036fc6714f0e7a5f9852da0",
"sha256:d3f27e276c8557c15c19c5c9a414e77b893d39fce6e6e40e5c46fcf5eeffe028",
"sha256:d40b82a4aee4ca968348e41bf6588ed9cadd171c7da8b671ed31d3fd967de703",
"sha256:d8cf054a099ff694a0e75386471bdde098efe7c350548ec6b899f169bef1a859",
"sha256:dd9f4843aa59f09698679b64064f11f51d60e45358ab45299de4dcff90524be3",
"sha256:e6f9f5ad4e73f5eecaa66e9c9d30ff8661c400190a6079ee170e37a466457e31",
"sha256:e9989e17f203900b2c7add53fa17d6686e66282598359b43fb12260ae8bf7eba",
"sha256:eadc9d19b25420e1ae77f0a11b779d4e71f47c3aa1953c218e8fe812d1f5341e",
"sha256:ecb630a99b0ab6c178b5c2988ca8c5b98f6ec2fd9e172c2873a5df44b261310f",
"sha256:f8eb9308bd64abf71dda77b823913696cd85c4f36c026acee0a64d8834a09b43",
"sha256:fe71a037ce866d9fb717fd3a792d46c744433179bf3f25da48af8f46cee20c3e",
"sha256:ff0d83306bfda4639fac2a4f8df2c51eb2bbdda540a74490703e8a6b413a37eb"
"sha256:02c830f951f3dc8c3164e2639a8961881390f7492f71a7835c2330f54539ad57",
"sha256:179015834c72a577486337394493cc2969feee9a04a2ea09f50c724e4b52ab42",
"sha256:3894960d43c64cfea5142ac783b101362f5008ee92e962392156a3f8d1558995",
"sha256:435821cb2501eabbcee7e83614bd710940dc0cf28b5afbc4bdb816c31cec71af",
"sha256:8294dea9aa1811f93558702856e3b68dd1dfd7e9dbc8e0865918a07ee0f21c2c",
"sha256:844e745ab27a9a01c86925fe776f9d2e09575e65f0bf8eba5090edddd655dffc",
"sha256:a08d49f5fa2a2243262fe5581cb89f6c0c7cc525b8d6411719ab9400a9dc4a82",
"sha256:a435c251246075337eb9fdc4160fd15c8a87cc0679d8d61fb5255d8d5a12f044",
"sha256:a799f03c0ec6d8687f425d7d6c075e8055a9a808f1ba87604d91f20507631d8d",
"sha256:aea72ce5b3a016b578cc05c04a2f68d9cafacf5d784b6fe832e66381cb62c719",
"sha256:c145e94c6da2af7eaf1fd827293ac1090a61a9b80150bebe99f8966a02378db9",
"sha256:c8a7b470c88c779301b73b23cabdbbd94b83b93040b2ccffa409e06df23831c0",
"sha256:c9e31b36abbd7b94c547d9047f13e1546e3ba967044cf4f9718575fcb7b81bb6",
"sha256:d960b7a03c33c328c723cfc2f8902a6291645f4efa0a5c1d4c5fa008cdc1ea77",
"sha256:da21fae4c173781b012217c9444f13c67449957a4d45184a9718268732c09564",
"sha256:db26c0fea0bd7d33c356da98bafd2c0dfb8f338e45e2824ff8f4f3e61b5c5f25",
"sha256:dc296c3f16ec620cfb4daf0f672e3c90f3920ece8261b2760cd0ebd9cd4daa55",
"sha256:e8da67cb2e9333ec30d53cfb96e27a4865d1648688e5471699070d35d8ab38cf",
"sha256:fb4f047a63f91f22aade4438aaf790400b96644e802daab4293e9b799802f93f",
"sha256:fef9939176cba0c2526ebeefffb8b9807543dc0954877b7226f751ec1294a869"
],
"index": "pypi",
"version": "==0.24.0"
"version": "==0.24.1"
},
"pbr": {
"hashes": [
"sha256:a7953f66e1f82e4b061f43096a4bcc058f7d3d41de9b94ac871770e8bdd831a2",
"sha256:d717573351cfe09f49df61906cd272abaa759b3e91744396b804965ff7bff38b"
],
"version": "==5.1.2"
},
"protobuf": {
"hashes": [
......@@ -289,10 +307,10 @@
},
"python-dateutil": {
"hashes": [
"sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93",
"sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02"
"sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
"sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
],
"version": "==2.7.5"
"version": "==2.8.0"
},
"pytz": {
"hashes": [
......@@ -336,36 +354,36 @@
},
"scipy": {
"hashes": [
"sha256:02cb79ea38114dc480e9b08d6b87095728e8fb39b9a49b449ee443d678001611",
"sha256:03c827cdbc584e935264040b958e5fa0570a16095bee23a013482ba3f0e963a2",
"sha256:04f2b23258139c109d0524f111597dd095a505d9cb2c71e381d688d653877fa3",
"sha256:3132a9fab3f3545c8b0ba15688d11857efdd4a58d388d3785dc474f56fea7138",
"sha256:4b1f0883cb9d8ee963cf0a31c87341e9e758abb2cf1e5bcc0d7b066ef6b17573",
"sha256:4cce25c6e7ff7399c67dfe1b5423c36c391cf9b4b2be390c1675ab410f1ef503",
"sha256:51a2424c8ed80e60bdb9a896806e7adaf24a58253b326fbad10f80a6d06f2214",
"sha256:5706b785ca289fdfd91aa05066619e51d140613b613e35932601f2315f5d8470",
"sha256:58f0435f052cb60f1472c77f52a8f6642f8877b70559e5e0b9a1744f33f5cbe5",
"sha256:63e1d5ca9e5e1984f1a275276991b036e25d39d37dd7edbb3f4f6165c2da7dbb",
"sha256:64b2c35824da3ef6bb1e722216e4ef28802af6413c7586136500e343d34ba179",
"sha256:6f791987899532305126309578727c0197bddbafab9596bafe3e7bfab6e1ce13",
"sha256:72bd766f753fd32f072d30d7bc2ad492d56dbcbf3e13764e27635d5c41079339",
"sha256:7413080b381766a22d52814edb65631f0e323a7cea945c70021a672f38acc73f",
"sha256:78a67ee4845440e81cfbfabde20537ca12051d0eeac951fe4c6d8751feac3103",
"sha256:7994c044bf659b0a24ad7673ec7db85c2fadb87e4980a379a9fd5b086fe3649a",
"sha256:7dc4002f0a0a688774ef04878afe769ecd1ac21fe9b4b1d7125e2cf16170afd3",
"sha256:854bd87cc23824d5db4983956bc30f3790e1c7448f1a9e6a8fb7bff7601aef87",
"sha256:8608316d0cc01f8b25111c8adfe6efbc959cbba037a62c784551568d7ffbf280",
"sha256:8f5fcc87b48fc3dd6d901669c89af4feeb856dffb6f671539a238b7e8af1799c",
"sha256:937147086e8b4338bf139ca8fa98da650e3a46bf2ca617f8e9dd68c3971ec420",
"sha256:bc294841f6c822714af362095b181a853f47ed5ce757354bd2e4776d579ff3a4",
"sha256:bc6a88b0009a1b60eab5c22ac3a006f6968d6328de10c6a64ebb0d64a05548d3",
"sha256:c5eae911cf26b3c7eda889ec98d3c226f312c587acfaaf02602473f98b4c16d6",
"sha256:cca33a01a5987c650b87a1a910aa311ffa44e67cca1ff502ef9efdae5d9a8624",
"sha256:d1ae77b79fd5e27a10ba7c4e7c3a62927b9d29a4dccf28f6905c25d983aaf183",
"sha256:fb36064047e6bf87b6320a9b6eb7f525ef6863c7a4aef1a84a4bbfb043612617",
"sha256:fc1a19d95649439dbd50baca676bceb29bbfcd600aed2c5bd71d9bad82a87cfe"
],
"version": "==1.2.0"
"sha256:014cb900c003b5ac81a53f2403294e8ecf37aedc315b59a6b9370dce0aa7627a",
"sha256:281a34da34a5e0de42d26aed692ab710141cad9d5d218b20643a9cb538ace976",
"sha256:588f9cc4bfab04c45fbd19c1354b5ade377a8124d6151d511c83730a9b6b2338",
"sha256:5a10661accd36b6e2e8855addcf3d675d6222006a15795420a39c040362def66",
"sha256:628f60be272512ca1123524969649a8cb5ae8b31cca349f7c6f8903daf9034d7",
"sha256:6dcc43a88e25b815c2dea1c6fac7339779fc988f5df8396e1de01610604a7c38",
"sha256:70e37cec0ac0fe95c85b74ca4e0620169590fd5d3f44765f3c3a532cedb0e5fd",
"sha256:7274735fb6fb5d67d3789ddec2cd53ed6362539b41aa6cc0d33a06c003aaa390",
"sha256:78e12972e144da47326958ac40c2bd1c1cca908edc8b01c26a36f9ffd3dce466",
"sha256:790cbd3c8d09f3a6d9c47c4558841e25bac34eb7a0864a9def8f26be0b8706af",
"sha256:79792c8fe8e9d06ebc50fe23266522c8c89f20aa94ac8e80472917ecdce1e5ba",
"sha256:865afedf35aaef6df6344bee0de391ee5e99d6e802950a237f9fb9b13e441f91",
"sha256:870fd401ec7b64a895cff8e206ee16569158db00254b2f7157b4c9a5db72c722",
"sha256:963815c226b29b0176d5e3d37fc9de46e2778ce4636a5a7af11a48122ef2577c",
"sha256:9726791484f08e394af0b59eb80489ad94d0a53bbb58ab1837dcad4d58489863",
"sha256:9de84a71bb7979aa8c089c4fb0ea0e2ed3917df3fb2a287a41aaea54bbad7f5d",
"sha256:b2c324ddc5d6dbd3f13680ad16a29425841876a84a1de23a984236d1afff4fa6",
"sha256:b86ae13c597fca087cb8c193870507c8916cefb21e52e1897da320b5a35075e5",
"sha256:ba0488d4dbba2af5bf9596b849873102d612e49a118c512d9d302ceafa36e01a",
"sha256:d78702af4102a3a4e23bb7372cec283e78f32f5573d92091aa6aaba870370fe1",
"sha256:def0e5d681dd3eb562b059d355ae8bebe27f5cc455ab7c2b6655586b63d3a8ea",
"sha256:e085d1babcb419bbe58e2e805ac61924dac4ca45a07c9fa081144739e500aa3c",
"sha256:e2cfcbab37c082a5087aba5ff00209999053260441caadd4f0e8f4c2d6b72088",
"sha256:e742f1f5dcaf222e8471c37ee3d1fd561568a16bb52e031c25674ff1cf9702d5",
"sha256:f06819b028b8ef9010281e74c59cb35483933583043091ed6b261bb1540f11cc",
"sha256:f15f2d60a11c306de7700ee9f65df7e9e463848dbea9c8051e293b704038da60",
"sha256:f31338ee269d201abe76083a990905473987371ff6f3fdb76a3f9073a361cf37",
"sha256:f6b88c8d302c3dac8dff7766955e38d670c82e0d79edfc7eae47d6bb2c186594"
],
"version": "==1.2.1"
},
"six": {
"hashes": [
......@@ -383,28 +401,37 @@
},
"tensorboard": {
"hashes": [
"sha256:6f194519f41762bfdf5eb410ccf33226d1c252caf5ad8893288648bfbcf4d135",
"sha256:81170f66bf8f95c2e9f6b3fefe0ddc5472655a9e3793e73b5b5d4ec0ba395e76"
"sha256:2ecfad35284e91d7c76945245c535245ba6900b0596d5c126d5b4ae3b434fb62",
"sha256:82c9c711b76949b7b3794fc319dc3d3b0fad25f7c0c5260ec4a8371b02d23da6"
],
"version": "==1.12.2"
"version": "==1.13.0"
},
"tensorflow": {
"hashes": [
"sha256:16fb8a59e724afd37a276d33b7e2ed070e5c84899a8d4cfc3fe1bb446a859da7",
"sha256:1ae50e44c0b29df5fb5b460118be5a257b4eb3e561008f64d2c4c715651259b7",
"sha256:1b7d09cc26ef727d628dcb74841b89374a38ed81af25bd589a21659ef67443da",
"sha256:2681b55d3e434e20fe98e3a3b1bde3588af62d7864b62feee4141a71e29ef594",
"sha256:42fc8398ce9f9895b488f516ea0143cf6cf2a3a5fc804da4a190b063304bc173",
"sha256:531619ad1c17b4084d09f442a9171318af813e81aae748e5de8274d561461749",
"sha256:5cee35f8a6a12e83560f30246811643efdc551c364bc981d27f21fbd0926403d",
"sha256:6ad6ed495f1a3d445c43d90cb2ce251ff5532fd6436e25f52977ee59ffa583df",
"sha256:cd8c1a899e3befe1ccb774ea1aae077a4b1286f855c956210b23766f4ac85c30",
"sha256:d3f3d7cd9bd4cdc7ebf25fd6c2dfc103dcf4b2834ae9276cc4cf897eb1515f6d",
"sha256:e4f479e6aca595acc98347364288cbdfd3c025ca85389380174ea75a43c327b7",
"sha256:f587dc03b5f0d1e50cca39b7159c9f21ffdec96273dbf5f7619d48c622cb21f2"
"sha256:0de5887495c20e1130ae4d9bcfaf80cec87f579a9c27a84141a588a46e5aa853",
"sha256:0f305f3c461ed2ce5e0b65fccc7b7452f483c7935dd8a52a466d622e642fdea8",
"sha256:4325f20b5a703b80a5f7a8807f07ad8735025bd2a947093ffff1c26fbdc7980b",
"sha256:4c86be0e476b64cedf4ffa059d71b764e75b895effb697345687e3057929a7b5",
"sha256:6b0a0a413390302ce7c22c98695983d6fb8406861cfb418b25536f57a96c0b89",
"sha256:77eec2351d0a9b5312ea01ee4c78c13996f249cf1bead2e68256a65e533f45ef",
"sha256:87bf719a564f11d63e4f614e933e5a612dd4e67c88266b774236e0982f5fcf69",
"sha256:ba29e66331cd2a8f824e0fa937ce44bd624bc37739f2f083694e473051d89ace",
"sha256:bc374f5a662b6e164cd1c4da61ccc752ec208a44893d2f9dcf47d2a0a2cef311",
"sha256:bcf86966b7554e407bb7d73341f2e108df62a910d40b4cd2a914867f2a5de51c",
"sha256:c3abffd51c168cfd62a557243c47a29ab48deb52a64465e6818060f20755ddb4",
"sha256:c41862c65628261229db22e33f9e570d845eeb5cea66dcbaebe404405edaa69b",
"sha256:d7341617aedd73c2c847755e87697e9c19eb625c73da26d6cd669220c5565119",
"sha256:de0425b58cb34006e4500565239b4c3a3055b95bff132f097fa46c87d8e463c9",
"sha256:f21fb65c8e874f40c654bc9b3ff3db3ec26f98f03fe64a541bc768f6f5c52ac2"
],
"index": "pypi",
"version": "==1.12.0"
"version": "==1.13.1"
},
"tensorflow-estimator": {
"hashes": [
"sha256:7cfdaa3e83e3532f31713713feb98be7ea9f3065722be4267e49b6c301271419"
],
"version": "==1.13.0"
},
"termcolor": {
"hashes": [
......@@ -412,6 +439,21 @@
],
"version": "==1.1.0"
},
"torch": {
"hashes": [
"sha256:2e04bcc8b6536ba01a924cbcfb9eff2428be6c9cc73956df38dfcf63c948fbf5",
"sha256:40ad926ebdef6db70811102ae1448584a0c338a2fce2ff718533b9016664398e",
"sha256:43e40d9cf70d038fe9a9c06eaadf3f39756fe76a530a0bd1dec9f21654ee5851",
"sha256:639e9414cd3a787c807206199bf3285815a41fac9b2e20aca0db9a971db5399e",
"sha256:652b70751bbe974370feff27f51b6cd7856c14a57eb06fdd1c9f2dfcc2731401",
"sha256:7822918f3d32a99db2bb5616a5c28d989d6e4b6a54d720cb25e60551dacafa1e",
"sha256:96fd5e8ffc117f79d1baaa65da601d35411f341d90d8ca1204236925f164b043",
"sha256:a002d509e98a3ea17f45affc5c440808d7ac119d7510bb27da7b184aafb59943",
"sha256:c8dd2478d3e8c0da293c618be60432bb166fe36c50663e26b1fe9e7123365fe5"
],
"index": "pypi",
"version": "==1.0.1.post2"
},
"werkzeug": {
"hashes": [
"sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c",
......@@ -421,11 +463,11 @@
},
"wheel": {
"hashes": [
"sha256:029703bf514e16c8271c3821806a1c171220cc5bdd325cbf4e7da1e056a01db6",
"sha256:1e53cdb3f808d5ccd0df57f964263752aa74ea7359526d3da6c02114ec1e1d44"
"sha256:66a8fd76f28977bb664b098372daef2b27f60dc4d1688cfab7b37a09448f0e9d",
"sha256:8eb4a788b3aec8abf5ff68d4165441bc57420c9f64ca5f471f58c3969fe08668"
],
"markers": "python_version >= '3'",
"version": "==0.32.3"
"version": "==0.33.1"
}
},
"develop": {}
......
......@@ -14,6 +14,7 @@ def np_arrays_from_scored_csv(file_name: str, label: int,
See usage in main
"""
# TODO enable load zero size array aswell
content = pandas.read_csv(Path(dirname(__file__)) / Path('scored')/Path(file_name))
batch = []
labels = []
......
import logging
import operator
from collections import Counter
from itertools import count
from typing import List
......@@ -10,7 +9,8 @@ import pulp
from config import RootConfig
from src.data.loader import np_arrays_from_scored_csv
from src.neural_networks.network import NeuralNetwork
from src.neural_networks.network import NeuralNetwork, FormattedBenignData, \
FormattedMaliciousData
logger = logging.getLogger(__name__)
......@@ -44,35 +44,46 @@ class GameSolver:
self.utility = conf.base_conf.utility_function
train = conf.nn_train_conf
self.benign_data = np_arrays_from_scored_csv(
train.benign_data_file_name,
0, train.benign_data_count)
self.benign_data_prob = self.calculate_benign_data_prob()
def calculate_benign_data_prob(self):
# TODO maybe this rounding is not really good for real results
benign_data = list(map(lambda x: tuple(map(lambda y: round(y, 2), x)),
self.benign_data[0]))
benign_data_prob = Counter(benign_data)
for key, val in benign_data_prob.items():
benign_data_prob[key] = val / len(benign_data)
return benign_data_prob
def _get_trained_nn(self, attacker_features_x, attacker_actions) -> NeuralNetwork:
raw_benign_x, _ = np_arrays_from_scored_csv(train.benign_data_file_name,
0, train.benign_data_count)
self.benign_data = self.prepare_benign_data(raw_benign_x)
def prepare_benign_data(self, raw_x_data):
unique, counts = np.unique(raw_x_data, axis=0, return_counts=True)
probs = np.array([count/len(raw_x_data) for count in counts])
benign_y = np.zeros(len(unique))
return FormattedBenignData(unique, probs, benign_y)
# def calculate_benign_data_with_probs(self):
# # TODO maybe this rounding is not really good for real results
# benign_data = list(map(lambda x: tuple(map(lambda y: round(y, 2), x)),
# self.benign_data[0]))
# benign_data_counter = Counter(benign_data)
# benign_data_points = []
# benign_data_probs = []
# for key, val in benign_data_counter.items():
# benign_data_points.append(key)
# benign_data_probs.append(val / len(benign_data))
# return np.array(benign_data_points), np.array(benign_data_probs)
def _get_trained_nn(self, attack: FormattedMaliciousData) -> NeuralNetwork:
# Initialize the model
network = NeuralNetwork(self.conf.base_conf.features_count,
self.conf.nn_conf,
self.conf.nn_train_conf)
network.set_attacker_actions(attacker_actions)
network.train(attacker_features_x, self.benign_data)
network.set_data(self.benign_data, attack)
network.train()
# TODO use different dataset to calc false_positives
# network.calc_n0_false_positives(self.benign_data[0])
return network
def double_oracle(self, actions_p1: List) -> Result:
non_attack = FormattedMaliciousData(np.empty(0), np.empty(0), np.empty(0))
# Get initial actions as the first ones
played_actions_p1 = set(actions_p1[:1])
played_actions_p2 = {self._get_trained_nn([[]])}
played_actions_p2 = {self._get_trained_nn(non_attack)}
for i in count():
logger.debug(f'Iteration: {i}\n')
......@@ -149,21 +160,16 @@ class GameSolver:
lambda a2: self.utility(a1, a2), actions_2), p2)))
def best_response_p2(self, used_actions_p1, probs_p1):
malicious_features = []
for ai, pi in zip(used_actions_p1, probs_p1):
counter = int(self.conf.nn_train_conf.malicious_data_count * pi)
for _ in range(counter):
malicious_features.append(ai)
# Take only attacker actions which are played with non zero probability
non_zero_p = np.where(np.asarray(probs_p1) != 0)
actions_2 = np.asarray(used_actions_p1)[non_zero_p]
p2 = np.asarray(probs_p1)[non_zero_p]
attacker_actions = (actions_2, p2)
unique_attack_x = np.asarray(used_actions_p1)[non_zero_p]
attack_probs = np.asarray(probs_p1)[non_zero_p]
attack_y = np.ones(len(unique_attack_x))
attack = FormattedMaliciousData(unique_attack_x, attack_probs, attack_y)
logger.debug('Let\'s train new NN with this malicious data:')
logger.debug(f'{malicious_features}\n')
return self._get_trained_nn(malicious_features, attacker_actions)
logger.debug(f'{unique_attack_x}\n')
return self._get_trained_nn(attack)
def solve_zero_sum_game_pulp(self, actions_p1: List[List[float]],
actions_p2: List[NeuralNetwork]):
......@@ -195,7 +201,8 @@ class GameSolver:
# Calc false positive cost with benign data probability distribution
fp_cost = 0
for features, features_prob in self.benign_data_prob.items():
benign_points, benign_probs = self.benign_data_with_probs
for features, features_prob in zip(benign_points, benign_probs):
for nn, nn_prob in zip(actions_p2, probs_p_two):
l = nn.limit_predict(features)[0]
fp_cost += (l**4) * features_prob * nn_prob
......
import logging
from pathlib import Path
from typing import List, Tuple
import attr
import numpy as np
import torch
from sklearn.model_selection import train_test_split
......@@ -14,6 +14,20 @@ from src.data.loader import np_arrays_from_scored_csv
logger = logging.getLogger(__name__)
# TODO one class is enough
@attr.s
class FormattedBenignData:
unique_x: np.array = attr.ib()
probs_x: np.array = attr.ib()
y: np.array = attr.ib()
@attr.s
class FormattedMaliciousData:
features: np.array = attr.ib()
probs_features: np.array = attr.ib()
y: np.array = attr.ib()
class OrderCounter:
order = 0
......@@ -36,71 +50,100 @@ class NeuralNetwork:
nn.Linear(12, 1),
nn.Sigmoid()
)
self.loss_fn = nn.BCELoss()
self.attacker_actions = None
self.epochs = nn_conf.epochs
self.validation_split = nn_train_conf.validation_split
self.id = OrderCounter.next()
self.order = OrderCounter.next()
def set_attacker_actions(self, attacker_actions: Tuple):
self.attacker_actions = attacker_actions
def loss_function(self):
pass
def _prepare_data(self, attacker_features_x: List[List[float]],
benign_data: Tuple[np.ndarray, np.ndarray]):
x, y = benign_data
# Add attacker's malicious actions to dataset
attacker_features_x = np.array(attacker_features_x)
if len(attacker_features_x[0]):
attacker_features_y = [[1] for _ in attacker_features_x]
x = np.concatenate((x, attacker_features_x), axis=0)
y = np.concatenate((y, attacker_features_y), axis=0)
# Variables used for loss function
self.attacker_actions: FormattedMaliciousData = None
self.benign_data: FormattedBenignData = None
# Shuffle benign and malicious data
x, y = shuffle(x, y, random_state=1)
# Split data so we have train dataset and validation dataset
data = train_test_split(x, y, test_size=self.validation_split)
# Convert data to float() for pyTorch model compatibility
data = tuple(map(lambda a: torch.from_numpy(a).float(), data))
# Return final data (x_train, x_validate, y_train, y_validate)
return data
def train(self,
attacker_features_x: List[List[float]],
benign_data: Tuple[np.ndarray, np.ndarray]):
data = self._prepare_data(attacker_features_x, benign_data)
x_train, x_validate, y_train, y_validate = data
self._train(x_train, y_train, x_validate, y_validate)
# TODO Just tmp
self.loss_fn = nn.BCELoss()
def _train(self, x, y, x_validate, y_validate):
learning_rate = 1e-2
def __str__(self):
return f'Neural network with id: {self.id}'
def set_data(self, benign_data, attack):
self.attacker_actions = attack
self.benign_data = benign_data
def loss_function(self, x, limits, real_y, probs):
zero_sum_part = real_y*(1-limits)*torch.prod(x, dim=1)*probs
fp_cost = (1-real_y)*probs*torch.pow(limits, 4)
sum_loss = torch.add(torch.sum(zero_sum_part), torch.sum(fp_cost))
return torch.div(sum_loss, len(x))
# Calc false positive cost
# def_indexes = (real_y == 0)
# def_limits = limits[def_indexes]
# def_probs = real_y[def_indexes]
# fp_cost = torch.pow(torch.pow(def_limits, 4), def_probs)
#
# # Calc zero sum part
# attacker_indexes = (real_y == 1)
# att_limits = limits[attacker_indexes]
# att_x = x[attacker_indexes]
# att_probs = probs[attacker_indexes]