diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 192067dc..5ac1e311 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -58,7 +58,7 @@ jobs: - name: Install Xircuits run: | - whl_name=$(echo dist/*whl)[learning] + whl_name=$(echo dist/*whl)[tensorflow_keras] pip install $whl_name - name: Setup Playwright diff --git a/examples/KerasModelPredict.xircuits b/examples/KerasModelPredict.xircuits index 0724f0bf..6c85560f 100644 --- a/examples/KerasModelPredict.xircuits +++ b/examples/KerasModelPredict.xircuits @@ -6,7 +6,7 @@ "gridSize": 0, "layers": [ { - "id": "5fc866d9-038b-43f5-8361-04938d7a594f", + "id": "2adbbc9f-6111-4230-9357-6a12574e7e4e", "type": "diagram-links", "isSvg": true, "transformed": true, @@ -23,14 +23,14 @@ { "id": "fa6f60da-38bf-4699-8d29-3a0f71029194", "type": "point", - "x": 655.9218161371626, - "y": 88.90626423394504 + "x": 655.922, + "y": 88.906 }, { "id": "eceda57f-15ca-4c78-9423-aaba80632f72", "type": "point", - "x": 721.9062494394014, - "y": 87.37501059005511 + "x": 721.906, + "y": 87.375 } ], "labels": [], @@ -51,14 +51,14 @@ { "id": "55fa8333-9e78-4880-a036-cce7bf8889c7", "type": "point", - "x": 79.42185895286943, - "y": 86.78125694616519 + "x": 79.422, + "y": 86.781 }, { "id": "5149fcf2-1d20-4184-bc13-da17ca692a7d", "type": "point", - "x": 176.09377130274115, - "y": 86.70312283644037 + "x": 154.601, + "y": 32.076 } ], "labels": [], @@ -79,14 +79,14 @@ { "id": "b9d96f52-4945-4b5e-b6ad-e1f726219d0c", "type": "point", - "x": 345.6093707955116, - "y": 86.70312283644037 + "x": 324.117, + "y": 32.076 }, { "id": "35d67aa2-b0f0-482c-8e9b-ae3101600369", "type": "point", - "x": 520.5000176588511, - "y": 88.90626423394504 + "x": 520.5, + "y": 88.906 } ], "labels": [], @@ -107,14 +107,14 @@ { "id": "a7afe144-4699-4fd8-9d05-8d080cac1884", "type": "point", - "x": 345.6093707955116, - "y": 102.70312465838533 + "x": 324.117, + "y": 48.076 }, { "id": "ff74cb39-e56e-4a2d-8a99-0b1a5d74bc3b", "type": "point", - "x": 520.5000176588511, - "y": 104.90623872671556 + "x": 520.5, + "y": 104.906 } ], "labels": [], @@ -135,14 +135,14 @@ { "id": "d8e2be28-764e-4800-adc1-8e63e38bf38d", "type": "point", - "x": 469.1562603710713, - "y": 202.01562283644037 + "x": 469.156, + "y": 202.016 }, { "id": "2b280c5f-1d7b-42f1-bd5b-fd7c807fd99d", "type": "point", - "x": 520.5000176588511, - "y": 120.90626787783495 + "x": 520.5, + "y": 120.906 } ], "labels": [], @@ -154,7 +154,7 @@ } }, { - "id": "ebc85549-142d-4b9b-b831-f882a714cf21", + "id": "2d0b94e0-5c75-49b9-9606-25e928bfb8ab", "type": "diagram-nodes", "isSvg": false, "transformed": true, @@ -166,14 +166,14 @@ "extras": { "type": "Start" }, - "x": 40.7336999214454, - "y": 52.15475255302436, + "x": 40.734, + "y": 52.155, "ports": [ { "id": "d4448be4-dea1-41e8-9f4f-b60f9fc85349", "type": "default", - "x": 71.92187261745666, - "y": 79.28125694616519, + "x": 71.925, + "y": 78.888, "name": "out-0", "alignment": "right", "parentNode": "c0aea849-8cc3-4005-be9c-a90d1c07f923", @@ -188,7 +188,8 @@ "color": "rgb(255,102,102)", "portsInOrder": [], "portsOutOrder": [ - "d4448be4-dea1-41e8-9f4f-b60f9fc85349" ] + "d4448be4-dea1-41e8-9f4f-b60f9fc85349" + ] }, "51d28ed7-01a1-489c-a3d0-b97d8e728d6b": { "id": "51d28ed7-01a1-489c-a3d0-b97d8e728d6b", @@ -198,14 +199,14 @@ "type": "Finish", "borderColor": "rgb(0,192,255)" }, - "x": 712.421052631579, - "y": 52.736842105263165, + "x": 712.421, + "y": 52.737, "ports": [ { "id": "8d112ff6-070f-4baa-8082-55ae3daf620c", "type": "default", - "x": 714.4062494394014, - "y": 79.87501059005511, + "x": 714.013, + "y": 79.463, "name": "in-0", "alignment": "left", "parentNode": "51d28ed7-01a1-489c-a3d0-b97d8e728d6b", @@ -229,17 +230,17 @@ "selected": false, "extras": { "type": "debug", - "path": "xai_components/xai_learning/tf_keras.py", + "path": "xai_components/xai_tensorflow_keras/tf_keras.py", "borderColor": "rgb(0,192,255)" }, - "x": 511.00867502312906, - "y": 54.28020959151419, + "x": 511.009, + "y": 54.28, "ports": [ { "id": "e117fb89-4723-4a01-b1df-cadcb2c07f28", "type": "default", - "x": 513.0000176588511, - "y": 81.40626423394504, + "x": 512.6, + "y": 81.013, "name": "in-0", "alignment": "left", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -252,8 +253,8 @@ { "id": "c4328f17-6591-4a5a-acb2-f15100bbdb1a", "type": "default", - "x": 648.4218161371626, - "y": 81.40626423394504, + "x": 648.425, + "y": 81.013, "name": "out-0", "alignment": "right", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -266,8 +267,8 @@ { "id": "575168a2-ea69-48f8-bb2f-ac5b845d73b9", "type": "default", - "x": 513.0000176588511, - "y": 97.40623872671556, + "x": 512.6, + "y": 97.013, "name": "parameter-any-model", "alignment": "left", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -280,8 +281,8 @@ { "id": "1e1cb1d5-89bb-4c94-b274-88bb6e9b06bb", "type": "default", - "x": 513.0000176588511, - "y": 113.40626787783496, + "x": 512.6, + "y": 113.013, "name": "parameter-string-img_string", "alignment": "left", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -294,8 +295,8 @@ { "id": "088d70f5-1274-4882-a247-3e08bb51e5aa", "type": "default", - "x": 513.0000176588511, - "y": 129.4062423706055, + "x": 512.6, + "y": 129.013, "name": "parameter-any-class_list", "alignment": "left", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -306,8 +307,8 @@ { "id": "370d4fdf-fe5d-4660-8235-407cbbd792b3", "type": "default", - "x": 513.0000176588511, - "y": 145.40624419255045, + "x": 512.6, + "y": 145.013, "name": "parameter-tuple-target_shape", "alignment": "left", "parentNode": "c7433158-a01f-4d71-92c1-6ee1b89aa259", @@ -332,20 +333,20 @@ "ea9a8791-4904-42af-a3b5-e6b10c92b251": { "id": "ea9a8791-4904-42af-a3b5-e6b10c92b251", "type": "custom-node", - "selected": false, + "selected": true, "extras": { "type": "debug", - "path": "xai_components/xai_learning/tf_keras.py", + "path": "xai_components/xai_tensorflow_keras/tf_keras.py", "borderColor": "rgb(0,192,255)" }, - "x": 166.59456220388603, - "y": 52.066541091906984, + "x": 145.102, + "y": -2.56, "ports": [ { "id": "3f35afbf-d124-45c4-ab06-7554fb38033e", "type": "default", - "x": 168.59377130274115, - "y": 79.20312283644037, + "x": 146.695, + "y": 24.173, "name": "in-0", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -358,8 +359,8 @@ { "id": "319a4672-78aa-433b-bb29-f15cd6b84ce6", "type": "default", - "x": 338.1093707955116, - "y": 79.20312283644037, + "x": 316.207, + "y": 24.173, "name": "out-0", "alignment": "right", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -372,8 +373,8 @@ { "id": "75c2d3fb-a0b1-47c9-a54b-c857ee365f2a", "type": "default", - "x": 168.59377130274115, - "y": 95.20312465838533, + "x": 146.695, + "y": 40.173, "name": "parameter-boolean-include_top", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -384,8 +385,8 @@ { "id": "911bdc77-7725-4566-baf1-2e2cc23eeaaf", "type": "default", - "x": 168.59377130274115, - "y": 111.2031264803303, + "x": 146.695, + "y": 56.173, "name": "parameter-string-weights", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -396,8 +397,8 @@ { "id": "19c5b298-8a4c-459b-82a2-a6ac9285a327", "type": "default", - "x": 168.59377130274115, - "y": 127.20312830227526, + "x": 146.695, + "y": 72.173, "name": "parameter-any-input_tensor", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -408,8 +409,8 @@ { "id": "c68d3a25-6ce8-4198-aed9-b9eb0c23c96a", "type": "default", - "x": 168.59377130274115, - "y": 143.20313012422022, + "x": 146.695, + "y": 88.173, "name": "parameter-any-input_shape", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -420,8 +421,8 @@ { "id": "d269558c-ed97-490a-9bfa-ea291689d42d", "type": "default", - "x": 168.59377130274115, - "y": 159.20313194616517, + "x": 146.695, + "y": 104.173, "name": "parameter-any-pooling", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -432,8 +433,8 @@ { "id": "faf18318-ab9d-4733-a202-0dc31865d27a", "type": "default", - "x": 168.59377130274115, - "y": 175.20313376811015, + "x": 146.695, + "y": 120.173, "name": "parameter-int-classes", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -444,8 +445,8 @@ { "id": "90baee99-bc5b-4822-88e3-f3bb7b55ba97", "type": "default", - "x": 168.59377130274115, - "y": 191.2031355900551, + "x": 146.695, + "y": 136.173, "name": "parameter-int-args", "alignment": "left", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -456,8 +457,8 @@ { "id": "5fa15600-adba-4c31-8a55-96f6941ed912", "type": "default", - "x": 338.1093707955116, - "y": 95.20312465838533, + "x": 316.207, + "y": 40.173, "name": "parameter-out-any-model", "alignment": "right", "parentNode": "ea9a8791-4904-42af-a3b5-e6b10c92b251", @@ -492,14 +493,14 @@ "extras": { "type": "string" }, - "x": 344.2531331847374, - "y": 167.3817905027475, + "x": 344.253, + "y": 167.382, "ports": [ { "id": "4783feae-eea2-407a-8bd0-50b1b42709a1", "type": "default", - "x": 461.6562603710713, - "y": 194.51562283644037, + "x": 461.263, + "y": 194.113, "name": "out-0", "alignment": "right", "parentNode": "d13e96ca-22a9-46a1-b3ca-967cc83d95b2", diff --git a/examples/KerasTrainImageClassifier.xircuits b/examples/KerasTrainImageClassifier.xircuits index 55327c06..a30bdb2b 100644 --- a/examples/KerasTrainImageClassifier.xircuits +++ b/examples/KerasTrainImageClassifier.xircuits @@ -1,36 +1,36 @@ { "id": "42c2ec4d-83dc-4458-9df3-52b03c5eb845", - "offsetX": -10.534886049583879, - "offsetY": 103.63701132053421, - "zoom": 73.01666666666685, + "offsetX": 4.497948510525406, + "offsetY": 44.895190551758034, + "zoom": 66.76666666666688, "gridSize": 0, "layers": [ { - "id": "a2b7ab76-d2a6-4cf3-9586-572e00364280", + "id": "1a8eb6a9-7d94-4a7d-8874-951a7e628a49", "type": "diagram-links", "isSvg": true, "transformed": true, "models": { - "5d372640-9f3f-45e7-936a-5e1166b29a99": { - "id": "5d372640-9f3f-45e7-936a-5e1166b29a99", - "type": "triangle", + "95c42363-5ab1-48c5-b89a-45795e2bd35a": { + "id": "95c42363-5ab1-48c5-b89a-45795e2bd35a", + "type": "custom", "selected": false, - "source": "1df74e98-686e-4c0d-9ff6-c85040db239d", - "sourcePort": "83fc3500-4b92-40b7-8b59-163596fb3d37", - "target": "b9e041cf-27c7-4488-ada4-6623adb0ab30", - "targetPort": "82ffb26d-208f-4c04-8b2c-c5342aae2641", + "source": "65bec10c-af39-4f21-8b71-7f1739960b5a", + "sourcePort": "e26c06f9-7a1f-4392-95ec-e3d049c6ce51", + "target": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", + "targetPort": "ebbacd59-7d59-4618-beaa-e01a0e571728", "points": [ { - "id": "d3fc5ce8-31ca-49a1-b244-5715b2dfb27e", + "id": "94f5f169-7f78-4f06-8646-18e367ce5228", "type": "point", - "x": 1390.45, - "y": 153.438 + "x": 130.537, + "y": 157.613 }, { - "id": "ae98ff54-af80-457b-83fe-fa78dae61b87", + "id": "86dadd4f-ee25-4863-a3fd-ff024d32b608", "type": "point", - "x": 1448.3, - "y": 173.275 + "x": 221.65, + "y": 64.7 } ], "labels": [], @@ -39,26 +39,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "f687255b-f113-4cc8-9455-fca307cd2b8c": { - "id": "f687255b-f113-4cc8-9455-fca307cd2b8c", - "type": "custom", + "4e6a7964-a8e2-458a-a7c9-82b396bc2f26": { + "id": "4e6a7964-a8e2-458a-a7c9-82b396bc2f26", + "type": "triangle", "selected": false, - "source": "9dca8612-5727-4d84-b9ac-16cdb3809f87", - "sourcePort": "f398f210-9249-40cc-a4df-af5ca6f72784", - "target": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "targetPort": "e4574193-6f5a-4a5e-b15e-fe865ea587eb", + "source": "8ec5f3e7-30bc-4ffe-9362-99a9a7475fe8", + "sourcePort": "ea0d5274-a264-4e83-be99-98dfd344b694", + "target": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", + "targetPort": "67fa0c11-517b-4ea4-817e-522657fdf5fe", "points": [ { - "id": "80f0e53f-abac-451b-9bd8-88d14f128605", + "id": "7419e1e6-8e36-470a-bbf6-0f735053d238", "type": "point", - "x": 829.425, - "y": 289.063 + "x": 122.412, + "y": 61.775 }, { - "id": "fec8f778-62d8-4ea3-b7d5-8332f92d2fc1", + "id": "f4d4d793-6bf0-4675-b432-c413e0c936ea", "type": "point", - "x": 930.187, - "y": 185.463 + "x": 221.65, + "y": 48.7 } ], "labels": [], @@ -67,26 +67,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "a4e1713d-7060-4688-b964-6d8fbd1403bc": { - "id": "a4e1713d-7060-4688-b964-6d8fbd1403bc", - "type": "triangle", + "b111d774-ede0-4559-b410-048663631893": { + "id": "b111d774-ede0-4559-b410-048663631893", + "type": "custom", "selected": false, - "source": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "sourcePort": "a47793b4-1bd1-4868-9c98-68c79d479953", - "target": "1df74e98-686e-4c0d-9ff6-c85040db239d", - "targetPort": "65093d30-9ff3-432b-bb4f-61702726567a", + "source": "bacd83a3-8d6e-4db5-ba21-bd3c25af184d", + "sourcePort": "31173d23-e739-4784-8444-88e9ba6ba94e", + "target": "05c0fc06-4724-4093-834f-815b266d9d2d", + "targetPort": "132ae55e-9d54-4e41-a0ef-6d360c4e4040", "points": [ { - "id": "64be150b-6b33-4cc0-a3ef-e2aa8a08c19f", + "id": "e1f66f21-44f9-481d-be5d-059539f89bbb", "type": "point", - "x": 1164.513, - "y": 137.463 + "x": 371.825, + "y": 256.763 }, { - "id": "57c60c21-645c-46ce-90f1-c50eb5423984", + "id": "d555900b-d276-42fb-b179-2e04036b82f5", "type": "point", - "x": 1213.613, - "y": 153.438 + "x": 514.763, + "y": 207.125 } ], "labels": [], @@ -95,26 +95,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "a2c477f9-f03b-4261-9e1a-aa7f6d2f2c9b": { - "id": "a2c477f9-f03b-4261-9e1a-aa7f6d2f2c9b", + "cc5b27e7-79ae-4dc6-8a1b-8d856cd3599c": { + "id": "cc5b27e7-79ae-4dc6-8a1b-8d856cd3599c", "type": "custom", "selected": false, - "source": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "sourcePort": "f56d6edf-c587-4ed1-9fd5-6d4996a3073e", - "target": "1df74e98-686e-4c0d-9ff6-c85040db239d", - "targetPort": "108a5afa-e846-4771-b519-f86f35a161a1", + "source": "d1ecf20f-3b86-4d76-b2ab-2f60fd95e63a", + "sourcePort": "e23b1613-a78f-4f28-9603-a3acfb1abd6e", + "target": "05c0fc06-4724-4093-834f-815b266d9d2d", + "targetPort": "968b5d01-a785-4909-8edd-9958e814f5c4", "points": [ { - "id": "0af96af9-60bb-4640-90cd-de8fd81f4fa2", + "id": "0324a0d5-76b0-4f7f-923a-b8dd6f2e187f", "type": "point", - "x": 1164.513, - "y": 153.462 + "x": 374.262, + "y": 325.45 }, { - "id": "e6ebabf6-ca6c-4512-953d-3f7db45f08ac", + "id": "c02df328-bdef-48d2-ad8d-f4d44a1b63dd", "type": "point", - "x": 1213.613, - "y": 169.438 + "x": 514.763, + "y": 239.125 } ], "labels": [], @@ -123,26 +123,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "fd6966a6-41e3-45ac-b00c-c5c3a9c774ee": { - "id": "fd6966a6-41e3-45ac-b00c-c5c3a9c774ee", + "225484e4-8985-4f32-8676-7640d50cd434": { + "id": "225484e4-8985-4f32-8676-7640d50cd434", "type": "triangle", "selected": false, - "source": "9bb883a7-3c66-443b-9ae3-02fd004c1566", - "sourcePort": "f8359848-295f-4d0c-97b1-5ad136dfc9f2", - "target": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "targetPort": "f28e4a7c-4a46-490c-b9cf-83a0c1fde6b0", + "source": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", + "sourcePort": "e11bec5e-9d46-4815-9ebe-00d08c41c184", + "target": "05c0fc06-4724-4093-834f-815b266d9d2d", + "targetPort": "500fb84b-3ce1-4dfb-82f8-fa4dbb977edc", "points": [ { - "id": "a9586f34-874c-4c40-b776-0ad34685710a", + "id": "27789cf4-32b9-4882-a8d8-ea2354fb3748", "type": "point", - "x": 865.188, - "y": 68.238 + "x": 427.838, + "y": 48.7 }, { - "id": "5a486d49-460e-4e8f-b749-94404e0d0114", + "id": "6310cb41-9cdd-4107-8f73-fa0844c2ce4c", "type": "point", - "x": 930.187, - "y": 137.463 + "x": 514.763, + "y": 175.125 } ], "labels": [], @@ -151,26 +151,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "b7fca48e-520d-4bbd-81db-5ec652b6565c": { - "id": "b7fca48e-520d-4bbd-81db-5ec652b6565c", + "5010ad26-261a-4751-9471-c333005d208e": { + "id": "5010ad26-261a-4751-9471-c333005d208e", "type": "custom", "selected": false, - "source": "9bb883a7-3c66-443b-9ae3-02fd004c1566", - "sourcePort": "8857aad6-5ef4-4ad3-900d-58921cacabef", - "target": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "targetPort": "67b7bf15-e4b3-4913-abeb-0528381c3f56", + "source": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", + "sourcePort": "960ee275-7663-419c-9320-8f97a31a7baa", + "target": "05c0fc06-4724-4093-834f-815b266d9d2d", + "targetPort": "0a349b76-12ca-4c4f-82cf-b27bef0b2dcb", "points": [ { - "id": "a8ed38b8-9399-45af-9393-5537e7160b71", + "id": "a65796ba-1b76-439d-91bd-18ff1cdb0608", "type": "point", - "x": 865.188, - "y": 84.237 + "x": 427.838, + "y": 64.7 }, { - "id": "f8417594-4cbf-402b-91b9-c1bde63c712c", + "id": "57fc6642-5c96-4b92-8629-bc4a79f81c61", "type": "point", - "x": 930.187, - "y": 153.462 + "x": 514.763, + "y": 191.125 } ], "labels": [], @@ -179,26 +179,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "4ed310fd-d886-4543-ae05-00461e58ca14": { - "id": "4ed310fd-d886-4543-ae05-00461e58ca14", + "4c8f9263-5fd1-4891-ac1b-1e3eb1bc4347": { + "id": "4c8f9263-5fd1-4891-ac1b-1e3eb1bc4347", "type": "custom", "selected": false, - "source": "bacd83a3-8d6e-4db5-ba21-bd3c25af184d", - "sourcePort": "31173d23-e739-4784-8444-88e9ba6ba94e", - "target": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "targetPort": "9594e3bf-0d9d-4a38-b8db-f40f1b08dfd6", + "source": "05c0fc06-4724-4093-834f-815b266d9d2d", + "sourcePort": "e26797bd-8987-4036-ac3b-00cf9966bb46", + "target": "637090d7-2038-4ccd-bf72-903db9b57f0d", + "targetPort": "52ee039f-344b-4d5e-931f-0dc4688088a0", "points": [ { - "id": "b21f6eef-3d3d-48f5-9d62-5a4b3702123b", + "id": "ee26f741-01cb-469c-819f-5978be025dd0", "type": "point", - "x": 372.225, - "y": 257.162 + "x": 682.425, + "y": 191.125 }, { - "id": "8e8cd75e-7442-48a7-9033-1f80117f8e3b", + "id": "c3b811ba-3e14-45c7-a356-25a5de797458", "type": "point", - "x": 477.275, - "y": 184.137 + "x": 616.373, + "y": -4.387 } ], "labels": [], @@ -207,26 +207,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "e3f98e43-e04a-499e-b095-907932b77a18": { - "id": "e3f98e43-e04a-499e-b095-907932b77a18", - "type": "custom", + "4afd2c77-a4e6-4381-8e05-c61cacd77c9e": { + "id": "4afd2c77-a4e6-4381-8e05-c61cacd77c9e", + "type": "triangle", "selected": false, - "source": "d1ecf20f-3b86-4d76-b2ab-2f60fd95e63a", - "sourcePort": "e23b1613-a78f-4f28-9603-a3acfb1abd6e", - "target": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "targetPort": "27686323-6728-4ced-aaf0-aca277b73cfc", + "source": "05c0fc06-4724-4093-834f-815b266d9d2d", + "sourcePort": "38de05cc-75b7-40d9-9aa1-eb2f29899ee9", + "target": "637090d7-2038-4ccd-bf72-903db9b57f0d", + "targetPort": "4e158e71-8d38-4ee0-ae99-a479793f2b61", "points": [ { - "id": "ed15b062-01cf-4a00-842a-b3cf911e4aaf", + "id": "76c9b276-11fd-45ba-a931-72e350d145c2", "type": "point", - "x": 374.662, - "y": 325.85 + "x": 682.425, + "y": 175.125 }, { - "id": "7310f2e9-948a-40d3-921d-0a716e668085", + "id": "a82e741a-dde9-47be-9b77-b2954b9b7379", "type": "point", - "x": 477.275, - "y": 216.137 + "x": 616.373, + "y": -20.387 } ], "labels": [], @@ -235,26 +235,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "ee697d1e-0f3f-486c-a3ab-7c4171c257cd": { - "id": "ee697d1e-0f3f-486c-a3ab-7c4171c257cd", + "fbdcb464-3d44-4e9e-b449-42f6bdc50113": { + "id": "fbdcb464-3d44-4e9e-b449-42f6bdc50113", "type": "custom", "selected": false, - "source": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "sourcePort": "e71aac04-247d-479f-ae2c-4ff0f358cd22", - "target": "1df74e98-686e-4c0d-9ff6-c85040db239d", - "targetPort": "c79caea5-1885-4e61-9273-45387cbd1eab", + "source": "9dca8612-5727-4d84-b9ac-16cdb3809f87", + "sourcePort": "f398f210-9249-40cc-a4df-af5ca6f72784", + "target": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "targetPort": "6dd470d3-51ff-4e9c-8b75-395f4e278efc", "points": [ { - "id": "e6a8ff1a-ff1e-49b5-b711-60a4a86a6bb1", + "id": "0f29b99c-9a0f-4051-9d98-b09d085b5605", "type": "point", - "x": 644.938, - "y": 184.137 + "x": 829.025, + "y": 288.663 }, { - "id": "b4d251a5-f70c-4c03-9383-390e2ec4dfc0", + "id": "f459c3aa-b874-43dd-8de4-c75a5ab136d9", "type": "point", - "x": 1213.613, - "y": 185.437 + "x": 902.838, + "y": 137.438 } ], "labels": [], @@ -263,26 +263,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "358ed13e-c5c4-4731-a2b2-54402bce2b59": { - "id": "358ed13e-c5c4-4731-a2b2-54402bce2b59", + "8a49a912-1a3e-4815-8de9-6da77f2fbcd6": { + "id": "8a49a912-1a3e-4815-8de9-6da77f2fbcd6", "type": "custom", "selected": false, - "source": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "sourcePort": "8cc8aadb-133b-4861-9289-55bfebc41b26", - "target": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "targetPort": "32e744fe-1271-418b-8b34-65efa08cfb4c", + "source": "05c0fc06-4724-4093-834f-815b266d9d2d", + "sourcePort": "e26797bd-8987-4036-ac3b-00cf9966bb46", + "target": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "targetPort": "bb12b905-2f42-4b6d-a018-5f5095c0e186", "points": [ { - "id": "6e4f6d62-e45c-43e2-845f-c205ffcbfee7", + "id": "45f477a8-da98-4289-8515-1bd037b593e7", "type": "point", - "x": 644.938, - "y": 168.138 + "x": 682.425, + "y": 191.125 }, { - "id": "f5ff8c91-88a1-4e2b-b390-d089faa5ec56", + "id": "fc561521-f8b7-40d7-8045-d2f17895d7df", "type": "point", - "x": 930.187, - "y": 169.463 + "x": 902.838, + "y": 121.437 } ], "labels": [], @@ -291,26 +291,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "2bf58cbe-bbb0-4ada-b35c-75f221a24024": { - "id": "2bf58cbe-bbb0-4ada-b35c-75f221a24024", - "type": "triangle", + "708c9146-2fe2-41a8-a2f6-70fbc871d9ef": { + "id": "708c9146-2fe2-41a8-a2f6-70fbc871d9ef", + "type": "custom", "selected": false, - "source": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "sourcePort": "9913e11c-57eb-483c-8e6a-23889093e986", - "target": "9bb883a7-3c66-443b-9ae3-02fd004c1566", - "targetPort": "029878ce-0e04-4b3b-a090-50528cbddccd", + "source": "637090d7-2038-4ccd-bf72-903db9b57f0d", + "sourcePort": "2ae44e7a-814a-436a-83ca-7d62a6fd76c9", + "target": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "targetPort": "255c08ee-c1ce-433b-a743-16e62bf389bc", "points": [ { - "id": "53569f40-3d52-4300-aa6b-ea690797da1b", + "id": "e3a3f7f6-b7ac-44bd-af86-878d32f77e92", "type": "point", - "x": 644.938, - "y": 152.138 + "x": 833.585, + "y": -4.387 }, { - "id": "a511182b-d6b6-499b-ad29-2ae3b18bd0aa", + "id": "1b220138-e2a2-4366-b954-343175956d32", "type": "point", - "x": 657.138, - "y": 68.238 + "x": 902.838, + "y": 105.438 } ], "labels": [], @@ -319,26 +319,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "81e50653-c315-4f80-b309-420e1262c099": { - "id": "81e50653-c315-4f80-b309-420e1262c099", - "type": "custom", + "98c9c29f-aeb1-4732-b5c6-f2b8bf2ed01d": { + "id": "98c9c29f-aeb1-4732-b5c6-f2b8bf2ed01d", + "type": "triangle", "selected": false, - "source": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "sourcePort": "8cc8aadb-133b-4861-9289-55bfebc41b26", - "target": "9bb883a7-3c66-443b-9ae3-02fd004c1566", - "targetPort": "df362df6-a268-4abe-9081-64574af66c98", + "source": "637090d7-2038-4ccd-bf72-903db9b57f0d", + "sourcePort": "fa220b70-9c98-4df9-b83e-32ae532ab9d2", + "target": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "targetPort": "cbb76641-cc8f-4c9e-8f98-b5fdeca0ea1d", "points": [ { - "id": "2b650a63-c989-4da1-b925-7e69160efdec", + "id": "365fddd1-7910-4c58-89e1-441642622c82", "type": "point", - "x": 644.938, - "y": 168.138 + "x": 833.585, + "y": -20.387 }, { - "id": "b0cc1ca0-ab74-4d86-b1d6-bf90732146a4", + "id": "e3924566-c117-4eb1-833b-6df585621729", "type": "point", - "x": 657.138, - "y": 84.237 + "x": 902.838, + "y": 89.438 } ], "labels": [], @@ -347,26 +347,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "dcbe8363-6f08-44dd-b65c-7a4dd2e4d58c": { - "id": "dcbe8363-6f08-44dd-b65c-7a4dd2e4d58c", + "f28c90f3-2f62-4ba8-ab88-7ca19f141822": { + "id": "f28c90f3-2f62-4ba8-ab88-7ca19f141822", "type": "triangle", "selected": false, - "source": "8ec5f3e7-30bc-4ffe-9362-99a9a7475fe8", - "sourcePort": "ea0d5274-a264-4e83-be99-98dfd344b694", - "target": "b453af74-9e09-4dfa-8c26-906e314b4054", - "targetPort": "0b139e93-dc50-40d6-a6e4-c277fef00e92", + "source": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "sourcePort": "e1ebc3bf-7f50-4322-bdf1-8aa96a3e83d5", + "target": "b43dd065-51e2-4d7a-b249-2452e33e5f31", + "targetPort": "414a7614-427e-4fbc-a191-53d6ef5d3ad8", "points": [ { - "id": "8323a7a3-49b4-4355-bacc-64f1c7f6fd6b", + "id": "e5ae6990-93cb-43b4-bab0-0de740b961bb", "type": "point", - "x": 136.325, - "y": 62.175 + "x": 1137.163, + "y": 89.438 }, { - "id": "804adbb6-e393-4d21-b24d-5778ae6e9718", + "id": "53dd0155-bfb0-4d22-a96e-60caac96af7b", "type": "point", - "x": 201.538, - "y": 84.313 + "x": 1200.35, + "y": 134.338 } ], "labels": [], @@ -375,26 +375,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "e4926133-bd63-4a8c-b50d-8d72de8a7630": { - "id": "e4926133-bd63-4a8c-b50d-8d72de8a7630", - "type": "triangle", + "39614266-bfa1-463a-95d2-c659e6d4b65d": { + "id": "39614266-bfa1-463a-95d2-c659e6d4b65d", + "type": "custom", "selected": false, - "source": "b453af74-9e09-4dfa-8c26-906e314b4054", - "sourcePort": "c3c6dfdc-9d61-4c55-9a1a-4ab029c96b58", - "target": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "targetPort": "5661aacd-aa08-45de-a48e-6cd562ffa19e", + "source": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "sourcePort": "3872faa9-7a3d-4f8b-9721-860d0b6a0198", + "target": "b43dd065-51e2-4d7a-b249-2452e33e5f31", + "targetPort": "0c3c8bda-9b78-4529-9a23-30e1df205854", "points": [ { - "id": "dd91d598-8e53-4ef8-96c0-2040312750ad", + "id": "2d244050-78db-4065-93be-64debf673b42", "type": "point", - "x": 407.725, - "y": 84.313 + "x": 1137.163, + "y": 105.438 }, { - "id": "26413bcb-c111-45ab-ac4d-a53db88266fd", + "id": "4309c20b-102a-4b9e-8935-8701d77b52b0", "type": "point", - "x": 477.275, - "y": 152.138 + "x": 1200.35, + "y": 150.338 } ], "labels": [], @@ -403,26 +403,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "39074613-63a9-4f7f-bc3b-23a245fb6e46": { - "id": "39074613-63a9-4f7f-bc3b-23a245fb6e46", + "ea7d26e8-d775-4a07-b971-9eadaf702b35": { + "id": "ea7d26e8-d775-4a07-b971-9eadaf702b35", "type": "custom", "selected": false, - "source": "b453af74-9e09-4dfa-8c26-906e314b4054", - "sourcePort": "7248b068-b063-421b-9468-fcda7829fd46", - "target": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "targetPort": "d26bdeed-84bb-4e23-9fa0-dcee3900c421", + "source": "05c0fc06-4724-4093-834f-815b266d9d2d", + "sourcePort": "029cfbcf-2836-4892-a550-75a0d1329d80", + "target": "b43dd065-51e2-4d7a-b249-2452e33e5f31", + "targetPort": "8492e5d5-def3-4412-a61e-b45794d88a6e", "points": [ { - "id": "c8c11833-39ad-4ed9-9cb8-164adfc45e58", + "id": "41b0a64a-2555-4df6-96b8-8cbe152f9f69", "type": "point", - "x": 407.725, - "y": 100.312 + "x": 682.425, + "y": 207.125 }, { - "id": "e7d08db3-ea95-44fc-8bb7-2cab60cc5ba2", + "id": "f5ab15ab-b0f0-499a-8881-bd9d7c7a5470", "type": "point", - "x": 477.275, - "y": 168.138 + "x": 1200.35, + "y": 166.338 } ], "labels": [], @@ -431,26 +431,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "9888e63f-2a42-495a-8785-85625afafad5": { - "id": "9888e63f-2a42-495a-8785-85625afafad5", - "type": "custom", + "ac60e2a5-0b4f-4f20-b75f-c8dc6f174ae6": { + "id": "ac60e2a5-0b4f-4f20-b75f-c8dc6f174ae6", + "type": "triangle", "selected": false, - "source": "65bec10c-af39-4f21-8b71-7f1739960b5a", - "sourcePort": "e26c06f9-7a1f-4392-95ec-e3d049c6ce51", - "target": "b453af74-9e09-4dfa-8c26-906e314b4054", - "targetPort": "a5362c25-6cd5-4cbc-9be0-b18bb596b8ab", + "source": "b43dd065-51e2-4d7a-b249-2452e33e5f31", + "sourcePort": "5ffa7a50-3523-4e14-9134-127d5d7d9159", + "target": "b9e041cf-27c7-4488-ada4-6623adb0ab30", + "targetPort": "82ffb26d-208f-4c04-8b2c-c5342aae2641", "points": [ { - "id": "70c4b23b-e091-4ee8-8f1d-faca687e3661", + "id": "4c31f06a-1564-4dd2-99c1-afe92c1efd2c", "type": "point", - "x": 130.938, - "y": 159.075 + "x": 1386.35, + "y": 134.338 }, { - "id": "8700064c-bad7-414c-b1a2-9a10f9fcaee3", + "id": "05652b60-fa28-4dad-9b82-94c2f8835b5a", "type": "point", - "x": 201.538, - "y": 100.312 + "x": 1447.9, + "y": 172.875 } ], "labels": [], @@ -462,7 +462,7 @@ } }, { - "id": "1bd5ebd5-a5ef-4f60-9962-06dec893d3f6", + "id": "b620b3af-e416-4fd2-b24e-1e5cc3c70813", "type": "diagram-nodes", "isSvg": false, "transformed": true, @@ -481,13 +481,13 @@ { "id": "ea0d5274-a264-4e83-be99-98dfd344b694", "type": "default", - "x": 128.825, - "y": 54.675, + "x": 114.912, + "y": 54.275, "name": "out-0", "alignment": "right", "parentNode": "8ec5f3e7-30bc-4ffe-9362-99a9a7475fe8", "links": [ - "dcbe8363-6f08-44dd-b65c-7a4dd2e4d58c" + "4e6a7964-a8e2-458a-a7c9-82b396bc2f26" ], "in": false, "label": "▶" @@ -497,7 +497,8 @@ "color": "rgb(255,102,102)", "portsInOrder": [], "portsOutOrder": [ - "ea0d5274-a264-4e83-be99-98dfd344b694" ] + "ea0d5274-a264-4e83-be99-98dfd344b694" + ] }, "b9e041cf-27c7-4488-ada4-6623adb0ab30": { "id": "b9e041cf-27c7-4488-ada4-6623adb0ab30", @@ -513,13 +514,13 @@ { "id": "82ffb26d-208f-4c04-8b2c-c5342aae2641", "type": "default", - "x": 1440.8, - "y": 165.775, + "x": 1440.4, + "y": 165.375, "name": "in-0", "alignment": "left", "parentNode": "b9e041cf-27c7-4488-ada4-6623adb0ab30", "links": [ - "5d372640-9f3f-45e7-936a-5e1166b29a99" + "ac60e2a5-0b4f-4f20-b75f-c8dc6f174ae6" ], "in": true, "label": "▶" @@ -541,18 +542,18 @@ "borderColor": "rgb(0,192,255)" }, "x": 64.681, - "y": 124.449, + "y": 123.383, "ports": [ { "id": "e26c06f9-7a1f-4392-95ec-e3d049c6ce51", "type": "default", - "x": 123.438, - "y": 151.575, + "x": 123.037, + "y": 150.113, "name": "out-0", "alignment": "right", "parentNode": "65bec10c-af39-4f21-8b71-7f1739960b5a", "links": [ - "9888e63f-2a42-495a-8785-85625afafad5" + "95c42363-5ab1-48c5-b89a-45795e2bd35a" ], "in": false, "label": "mnist" @@ -579,13 +580,13 @@ { "id": "f398f210-9249-40cc-a4df-af5ca6f72784", "type": "default", - "x": 821.925, - "y": 281.563, + "x": 821.525, + "y": 281.163, "name": "out-0", "alignment": "right", "parentNode": "9dca8612-5727-4d84-b9ac-16cdb3809f87", "links": [ - "f687255b-f113-4cc8-9455-fca307cd2b8c" + "fbdcb464-3d44-4e9e-b449-42f6bdc50113" ], "in": false, "label": "1" @@ -612,8 +613,8 @@ { "id": "febcddf4-e51c-4c55-8bfc-7a0f57be6d5a", "type": "default", - "x": 128.562, - "y": 279.35, + "x": 128.162, + "y": 278.95, "name": "out-0", "alignment": "right", "parentNode": "df8259bd-7432-41e7-9d9f-a42c5e25bf2d", @@ -642,8 +643,8 @@ { "id": "494abf19-7846-4d3a-a29e-93bcb7a1364e", "type": "default", - "x": 131.863, - "y": 339, + "x": 131.462, + "y": 338.6, "name": "out-0", "alignment": "right", "parentNode": "cdeb7e03-837a-46a0-a5e8-55f1fb7fd90f", @@ -673,13 +674,13 @@ { "id": "31173d23-e739-4784-8444-88e9ba6ba94e", "type": "default", - "x": 364.725, - "y": 249.663, + "x": 364.325, + "y": 249.263, "name": "out-0", "alignment": "right", "parentNode": "bacd83a3-8d6e-4db5-ba21-bd3c25af184d", "links": [ - "4ed310fd-d886-4543-ae05-00461e58ca14" + "b111d774-ede0-4559-b410-048663631893" ], "in": false, "label": "0.8" @@ -706,13 +707,13 @@ { "id": "e23b1613-a78f-4f28-9603-a3acfb1abd6e", "type": "default", - "x": 367.162, - "y": 318.35, + "x": 366.763, + "y": 317.95, "name": "out-0", "alignment": "right", "parentNode": "d1ecf20f-3b86-4d76-b2ab-2f60fd95e63a", "links": [ - "e3f98e43-e04a-499e-b095-907932b77a18" + "cc5b27e7-79ae-4dc6-8a1b-8d856cd3599c" ], "in": false, "label": "False" @@ -738,8 +739,8 @@ { "id": "2c6bd512-c9a9-490a-aee8-a2961128a575", "type": "default", - "x": 126.363, - "y": 219.638, + "x": 125.962, + "y": 219.238, "name": "out-0", "alignment": "right", "parentNode": "4943bdc8-a5a4-4a28-89b3-a7f841696f69", @@ -755,550 +756,593 @@ "2c6bd512-c9a9-490a-aee8-a2961128a575" ] }, - "1df74e98-686e-4c0d-9ff6-c85040db239d": { - "id": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "158b322d-4fb9-415c-ade2-ec21b2d0a7bd": { + "id": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "type": "custom-node", "selected": false, "extras": { - "type": "eval", - "path": "xai_components/xai_learning/training.py" + "type": "debug", + "path": "xai_components/xai_tensorflow_keras/training.py", + "description": "Loads a Keras image dataset or creates a dataset from a directory.\n\n### Reference:\n- Keras Model Applications: https://keras.io/api/datasets/\n\n##### inPorts:\n- dataset_name: Loads a Keras image dataset given a valid string \n (mnist / mnist fasion / cifar10 / cifar 100) OR \n creates a dataset object when given a valid dataset directory path. \n \n For the latter, the directory must have subdirectories and each \n subdirectory name will be treated as its own class.\n\n for example, when given a Literal String `DATASET`, the structure must be:\n working_dir/\n |- DATASET \n |- CLASS_1\n |- CLASS_2\n |- CLASS_3\n \n##### outPorts:\n- dataset: a dataset tuple\n- class_dict: dict of classes if not using IMAGENET.", + "lineNo": [ + { + "lineno": 12, + "end_lineno": 147 + } + ], + "borderColor": "rgb(0,192,255)" }, - "x": 1204.117, - "y": 118.808, + "x": 212.562, + "y": 14.464, "ports": [ { - "id": "65093d30-9ff3-432b-bb4f-61702726567a", + "id": "67fa0c11-517b-4ea4-817e-522657fdf5fe", "type": "default", - "x": 1206.113, - "y": 145.937, + "x": 214.15, + "y": 41.2, "name": "in-0", "alignment": "left", - "parentNode": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "parentNode": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "links": [ - "a4e1713d-7060-4688-b964-6d8fbd1403bc" + "4e6a7964-a8e2-458a-a7c9-82b396bc2f26" ], "in": true, "label": "▶" }, { - "id": "83fc3500-4b92-40b7-8b59-163596fb3d37", + "id": "e11bec5e-9d46-4815-9ebe-00d08c41c184", "type": "default", - "x": 1382.95, - "y": 145.937, + "x": 420.338, + "y": 41.2, "name": "out-0", "alignment": "right", - "parentNode": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "parentNode": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "links": [ - "5d372640-9f3f-45e7-936a-5e1166b29a99" + "225484e4-8985-4f32-8676-7640d50cd434" ], "in": false, "label": "▶" }, { - "id": "108a5afa-e846-4771-b519-f86f35a161a1", + "id": "ebbacd59-7d59-4618-beaa-e01a0e571728", "type": "default", - "x": 1206.113, - "y": 161.938, - "name": "parameter-any-model", + "x": 214.15, + "y": 57.2, + "name": "parameter-string-dataset_name", "alignment": "left", - "parentNode": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "parentNode": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "links": [ - "a2c477f9-f03b-4261-9e1a-aa7f6d2f2c9b" + "95c42363-5ab1-48c5-b89a-45795e2bd35a" ], "in": true, - "label": "model" + "label": "★dataset_name" }, { - "id": "c79caea5-1885-4e61-9273-45387cbd1eab", + "id": "960ee275-7663-419c-9320-8f97a31a7baa", "type": "default", - "x": 1206.113, - "y": 177.937, - "name": "parameter-any-eval_dataset", - "alignment": "left", - "parentNode": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "x": 420.338, + "y": 57.2, + "name": "parameter-out-Tuple[np.array, np.array]-dataset", + "alignment": "right", + "parentNode": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "links": [ - "ee697d1e-0f3f-486c-a3ab-7c4171c257cd" + "5010ad26-261a-4751-9471-c333005d208e" ], - "in": true, - "label": "eval_dataset" + "in": false, + "label": "dataset" }, { - "id": "bc6951c0-6acf-482f-aca7-cd145199bc3e", + "id": "e1ccea97-6e1e-4430-9b3d-7277a8383987", "type": "default", - "x": 1382.95, - "y": 161.938, - "name": "parameter-out-Dict[str, str]-metrics", + "x": 420.338, + "y": 73.2, + "name": "parameter-out-dict-class_dict", "alignment": "right", - "parentNode": "1df74e98-686e-4c0d-9ff6-c85040db239d", + "parentNode": "158b322d-4fb9-415c-ade2-ec21b2d0a7bd", "links": [], "in": false, - "label": "metrics" + "label": "class_dict" } ], - "name": "EvaluateAccuracy", - "color": "rgb(153,51,204)", + "name": "ReadKerasDataSet", + "color": "rgb(255,102,0)", "portsInOrder": [ - "65093d30-9ff3-432b-bb4f-61702726567a", - "108a5afa-e846-4771-b519-f86f35a161a1", - "c79caea5-1885-4e61-9273-45387cbd1eab" + "67fa0c11-517b-4ea4-817e-522657fdf5fe", + "ebbacd59-7d59-4618-beaa-e01a0e571728" ], "portsOutOrder": [ - "83fc3500-4b92-40b7-8b59-163596fb3d37", - "bc6951c0-6acf-482f-aca7-cd145199bc3e" + "e11bec5e-9d46-4815-9ebe-00d08c41c184", + "960ee275-7663-419c-9320-8f97a31a7baa", + "e1ccea97-6e1e-4430-9b3d-7277a8383987" ] }, - "68323fd7-b170-4e8d-85c4-2ccca655d273": { - "id": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "05c0fc06-4724-4093-834f-815b266d9d2d": { + "id": "05c0fc06-4724-4093-834f-815b266d9d2d", "type": "custom-node", "selected": false, "extras": { - "type": "train", - "path": "xai_components/xai_learning/training.py" + "type": "debug", + "path": "xai_components/xai_tensorflow_keras/training.py", + "description": "Takes a dataset tuple and splits it into train test tuples.\n\n### Reference: \n- [Scikit-learn Train Test Split](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html)\n\n##### inPorts:\n- dataset: dataset in the form of np array tuples. `Tuple[np.array, np.array]`\n- train_split: float ratio of the train split. Default `0.75`.\n- random_state: seed for random state. Default `None`.\n- shuffle: Enable dataset shuffle with True / False. Default `True`.\n- stratify: Data is split in a stratified fashion, using this as the class labels. \n Default `None`.\n\n##### outPorts:\n- train: tuple that contains the train split of the dataset.\n- test:tuple that contains the test split of the dataset.\n- resized_dataset: 1D tuple object.", + "lineNo": [ + { + "lineno": 182, + "end_lineno": 244 + } + ], + "borderColor": "rgb(0,192,255)" }, - "x": 920.698, - "y": 102.835, + "x": 505.668, + "y": 140.899, "ports": [ { - "id": "f28e4a7c-4a46-490c-b9cf-83a0c1fde6b0", + "id": "500fb84b-3ce1-4dfb-82f8-fa4dbb977edc", "type": "default", - "x": 922.688, - "y": 129.963, + "x": 507.263, + "y": 167.625, "name": "in-0", "alignment": "left", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "fd6966a6-41e3-45ac-b00c-c5c3a9c774ee" + "225484e4-8985-4f32-8676-7640d50cd434" ], "in": true, "label": "▶" }, { - "id": "a47793b4-1bd1-4868-9c98-68c79d479953", + "id": "38de05cc-75b7-40d9-9aa1-eb2f29899ee9", "type": "default", - "x": 1157.013, - "y": 129.963, + "x": 674.925, + "y": 167.625, "name": "out-0", "alignment": "right", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "a4e1713d-7060-4688-b964-6d8fbd1403bc" + "4afd2c77-a4e6-4381-8e05-c61cacd77c9e" ], "in": false, "label": "▶" }, { - "id": "67b7bf15-e4b3-4913-abeb-0528381c3f56", + "id": "0a349b76-12ca-4c4f-82cf-b27bef0b2dcb", "type": "default", - "x": 922.688, - "y": 145.962, - "name": "parameter-any-model", + "x": 507.263, + "y": 183.625, + "name": "parameter-Tuple[np.array, np.array]-dataset", "alignment": "left", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "b7fca48e-520d-4bbd-81db-5ec652b6565c" + "5010ad26-261a-4751-9471-c333005d208e" ], "in": true, - "label": "model" + "label": "★dataset" }, { - "id": "32e744fe-1271-418b-8b34-65efa08cfb4c", + "id": "132ae55e-9d54-4e41-a0ef-6d360c4e4040", "type": "default", - "x": 922.688, - "y": 161.963, - "name": "parameter-any-training_data", + "x": 507.263, + "y": 199.625, + "name": "parameter-float-train_split", "alignment": "left", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "358ed13e-c5c4-4731-a2b2-54402bce2b59" + "b111d774-ede0-4559-b410-048663631893" ], "in": true, - "label": "training_data" + "label": "train_split" }, { - "id": "e4574193-6f5a-4a5e-b15e-fe865ea587eb", + "id": "e22ac242-d62b-4e5d-b8c6-67acb3e86ac2", "type": "default", - "x": 922.688, - "y": 177.963, - "name": "parameter-int-training_epochs", + "x": 507.263, + "y": 215.625, + "name": "parameter-int-random_state", + "alignment": "left", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", + "links": [], + "in": true, + "label": "random_state" + }, + { + "id": "968b5d01-a785-4909-8edd-9958e814f5c4", + "type": "default", + "x": 507.263, + "y": 231.625, + "name": "parameter-boolean-shuffle", "alignment": "left", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "f687255b-f113-4cc8-9455-fca307cd2b8c" + "cc5b27e7-79ae-4dc6-8a1b-8d856cd3599c" ], "in": true, - "label": "training_epochs" + "label": "shuffle" }, { - "id": "f56d6edf-c587-4ed1-9fd5-6d4996a3073e", + "id": "447c5715-3955-4d74-836a-9f7fa559c1c0", "type": "default", - "x": 1157.013, - "y": 145.962, - "name": "parameter-out-keras.Sequential-trained_model", + "x": 507.263, + "y": 247.625, + "name": "parameter-any-stratify", + "alignment": "left", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", + "links": [], + "in": true, + "label": "stratify" + }, + { + "id": "e26797bd-8987-4036-ac3b-00cf9966bb46", + "type": "default", + "x": 674.925, + "y": 183.625, + "name": "parameter-out-Tuple[np.array, np.array]-train", "alignment": "right", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", "links": [ - "a2c477f9-f03b-4261-9e1a-aa7f6d2f2c9b" + "4c8f9263-5fd1-4891-ac1b-1e3eb1bc4347", + "8a49a912-1a3e-4815-8de9-6da77f2fbcd6" ], "in": false, - "label": "trained_model" + "label": "train" }, { - "id": "f83929ec-f3d3-4b18-941c-2c9b54e1260a", + "id": "029cfbcf-2836-4892-a550-75a0d1329d80", "type": "default", - "x": 1157.013, - "y": 161.963, - "name": "parameter-out-dict-training_metrics", + "x": 674.925, + "y": 199.625, + "name": "parameter-out-Tuple[np.array, np.array]-test", "alignment": "right", - "parentNode": "68323fd7-b170-4e8d-85c4-2ccca655d273", - "links": [], + "parentNode": "05c0fc06-4724-4093-834f-815b266d9d2d", + "links": [ + "ea7d26e8-d775-4a07-b971-9eadaf702b35" + ], "in": false, - "label": "training_metrics" + "label": "test" } ], - "name": "TrainImageClassifier", - "color": "rgb(102,51,102)", + "name": "TrainTestSplit", + "color": "rgb(192,255,0)", "portsInOrder": [ - "f28e4a7c-4a46-490c-b9cf-83a0c1fde6b0", - "67b7bf15-e4b3-4913-abeb-0528381c3f56", - "32e744fe-1271-418b-8b34-65efa08cfb4c", - "e4574193-6f5a-4a5e-b15e-fe865ea587eb" + "500fb84b-3ce1-4dfb-82f8-fa4dbb977edc", + "0a349b76-12ca-4c4f-82cf-b27bef0b2dcb", + "132ae55e-9d54-4e41-a0ef-6d360c4e4040", + "e22ac242-d62b-4e5d-b8c6-67acb3e86ac2", + "968b5d01-a785-4909-8edd-9958e814f5c4", + "447c5715-3955-4d74-836a-9f7fa559c1c0" ], "portsOutOrder": [ - "a47793b4-1bd1-4868-9c98-68c79d479953", - "f56d6edf-c587-4ed1-9fd5-6d4996a3073e", - "f83929ec-f3d3-4b18-941c-2c9b54e1260a" + "38de05cc-75b7-40d9-9aa1-eb2f29899ee9", + "e26797bd-8987-4036-ac3b-00cf9966bb46", + "029cfbcf-2836-4892-a550-75a0d1329d80" ] }, - "9bb883a7-3c66-443b-9ae3-02fd004c1566": { - "id": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "637090d7-2038-4ccd-bf72-903db9b57f0d": { + "id": "637090d7-2038-4ccd-bf72-903db9b57f0d", "type": "custom-node", - "selected": false, + "selected": true, "extras": { - "type": "model", - "path": "xai_components/xai_learning/training.py" + "type": "debug", + "path": "xai_components/xai_tensorflow_keras/training.py", + "description": "Takes a 2D dataset tuple and creates a 2D Keras model.\n\n##### inPorts:\n- training_data: dataset tuple which contains 2D numpy array.\n\n##### outPorts:\n- model: keras model.\n- model_config: keras model config dict. \n Contains 'lr', 'optimizer_name' and 'loss'.", + "lineNo": [ + { + "lineno": 286, + "end_lineno": 345 + } + ] }, - "x": 647.638, - "y": 33.602, + "x": 607.278, + "y": -54.632, "ports": [ { - "id": "029878ce-0e04-4b3b-a090-50528cbddccd", + "id": "4e158e71-8d38-4ee0-ae99-a479793f2b61", "type": "default", - "x": 649.638, - "y": 60.737, + "x": 608.873, + "y": -27.887, "name": "in-0", "alignment": "left", - "parentNode": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "parentNode": "637090d7-2038-4ccd-bf72-903db9b57f0d", "links": [ - "2bf58cbe-bbb0-4ada-b35c-75f221a24024" + "4afd2c77-a4e6-4381-8e05-c61cacd77c9e" ], "in": true, "label": "▶" }, { - "id": "f8359848-295f-4d0c-97b1-5ad136dfc9f2", + "id": "fa220b70-9c98-4df9-b83e-32ae532ab9d2", "type": "default", - "x": 857.688, - "y": 60.737, + "x": 826.085, + "y": -27.887, "name": "out-0", "alignment": "right", - "parentNode": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "parentNode": "637090d7-2038-4ccd-bf72-903db9b57f0d", "links": [ - "fd6966a6-41e3-45ac-b00c-c5c3a9c774ee" + "98c9c29f-aeb1-4732-b5c6-f2b8bf2ed01d" ], "in": false, "label": "▶" }, { - "id": "df362df6-a268-4abe-9081-64574af66c98", + "id": "52ee039f-344b-4d5e-931f-0dc4688088a0", "type": "default", - "x": 649.638, - "y": 76.737, - "name": "parameter-any-training_data", + "x": 608.873, + "y": -11.887, + "name": "parameter-Tuple[np.array, np.array]-training_data", "alignment": "left", - "parentNode": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "parentNode": "637090d7-2038-4ccd-bf72-903db9b57f0d", "links": [ - "81e50653-c315-4f80-b309-420e1262c099" + "4c8f9263-5fd1-4891-ac1b-1e3eb1bc4347" ], "in": true, - "label": "training_data" + "label": "★training_data" }, { - "id": "8857aad6-5ef4-4ad3-900d-58921cacabef", + "id": "2ae44e7a-814a-436a-83ca-7d62a6fd76c9", "type": "default", - "x": 857.688, - "y": 76.737, + "x": 826.085, + "y": -11.887, "name": "parameter-out-keras.Sequential-model", "alignment": "right", - "parentNode": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "parentNode": "637090d7-2038-4ccd-bf72-903db9b57f0d", "links": [ - "b7fca48e-520d-4bbd-81db-5ec652b6565c" + "708c9146-2fe2-41a8-a2f6-70fbc871d9ef" ], "in": false, "label": "model" }, { - "id": "75356dba-6f26-4fe9-ad84-86eada24acba", + "id": "db4676b3-1904-47e9-b3d4-25e61d658b59", "type": "default", - "x": 857.688, - "y": 92.737, + "x": 826.085, + "y": 4.113, "name": "parameter-out-dict-model_config", "alignment": "right", - "parentNode": "9bb883a7-3c66-443b-9ae3-02fd004c1566", + "parentNode": "637090d7-2038-4ccd-bf72-903db9b57f0d", "links": [], "in": false, "label": "model_config" } ], - "name": "Create2DInputModel", - "color": "rgb(153,0,102)", + "name": "KerasCreate2DInputModel", + "color": "rgb(255,153,102)", "portsInOrder": [ - "029878ce-0e04-4b3b-a090-50528cbddccd", - "df362df6-a268-4abe-9081-64574af66c98" + "4e158e71-8d38-4ee0-ae99-a479793f2b61", + "52ee039f-344b-4d5e-931f-0dc4688088a0" ], "portsOutOrder": [ - "f8359848-295f-4d0c-97b1-5ad136dfc9f2", - "8857aad6-5ef4-4ad3-900d-58921cacabef", - "75356dba-6f26-4fe9-ad84-86eada24acba" + "fa220b70-9c98-4df9-b83e-32ae532ab9d2", + "2ae44e7a-814a-436a-83ca-7d62a6fd76c9", + "db4676b3-1904-47e9-b3d4-25e61d658b59" ] }, - "75fa2162-1bad-4b72-8730-8d0956d6d135": { - "id": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "locked": false, + "296fb807-ed24-4ede-8cc0-1928ed2e2ca4": { + "id": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "type": "custom-node", "selected": false, "extras": { - "type": "split", - "path": "xai_components/xai_learning/training.py", + "type": "debug", + "path": "xai_components/xai_tensorflow_keras/training.py", + "description": "Trains a Keras model for image classification.\n\n##### inPorts:\n- model: a Keras model object.\n- training_data: a dataset tuple with (X (data), Y (label)).\n- training_epochs: number of training epochs. Default `1`.\n\n##### outPorts:\n- trained_model: trained Keras model config.\n- training_metrics: dict which contains results of training.", + "lineNo": [ + { + "lineno": 349, + "end_lineno": 398 + } + ], "borderColor": "rgb(0,192,255)" }, - "x": 467.783, - "y": 117.502, + "x": 893.744, + "y": 55.204, "ports": [ { - "id": "5661aacd-aa08-45de-a48e-6cd562ffa19e", + "id": "cbb76641-cc8f-4c9e-8f98-b5fdeca0ea1d", "type": "default", - "x": 469.775, - "y": 144.637, + "x": 895.338, + "y": 81.938, "name": "in-0", "alignment": "left", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "e4926133-bd63-4a8c-b50d-8d72de8a7630" + "98c9c29f-aeb1-4732-b5c6-f2b8bf2ed01d" ], "in": true, "label": "▶" }, { - "id": "9913e11c-57eb-483c-8e6a-23889093e986", + "id": "e1ebc3bf-7f50-4322-bdf1-8aa96a3e83d5", "type": "default", - "x": 637.438, - "y": 144.637, + "x": 1129.663, + "y": 81.938, "name": "out-0", "alignment": "right", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "2bf58cbe-bbb0-4ada-b35c-75f221a24024" + "f28c90f3-2f62-4ba8-ab88-7ca19f141822" ], "in": false, "label": "▶" }, { - "id": "d26bdeed-84bb-4e23-9fa0-dcee3900c421", + "id": "255c08ee-c1ce-433b-a743-16e62bf389bc", "type": "default", - "x": 469.775, - "y": 160.638, - "name": "parameter-any-dataset", + "x": 895.338, + "y": 97.938, + "name": "parameter-keras.Sequential-model", "alignment": "left", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "39074613-63a9-4f7f-bc3b-23a245fb6e46" + "708c9146-2fe2-41a8-a2f6-70fbc871d9ef" ], "in": true, - "label": "dataset" + "label": "★model" }, { - "id": "9594e3bf-0d9d-4a38-b8db-f40f1b08dfd6", + "id": "bb12b905-2f42-4b6d-a018-5f5095c0e186", "type": "default", - "x": 469.775, - "y": 176.637, - "name": "parameter-float-train_split", + "x": 895.338, + "y": 113.937, + "name": "parameter-Tuple[np.array, np.array]-training_data", "alignment": "left", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "4ed310fd-d886-4543-ae05-00461e58ca14" + "8a49a912-1a3e-4815-8de9-6da77f2fbcd6" ], "in": true, - "label": "train_split" - }, - { - "id": "e1bb025a-eae6-456f-b150-45a19571067f", - "type": "default", - "x": 469.775, - "y": 192.638, - "name": "parameter-int-random_state", - "alignment": "left", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "links": [], - "in": true, - "label": "random_state" + "label": "★training_data" }, { - "id": "27686323-6728-4ced-aaf0-aca277b73cfc", + "id": "6dd470d3-51ff-4e9c-8b75-395f4e278efc", "type": "default", - "x": 469.775, - "y": 208.637, - "name": "parameter-boolean-shuffle", + "x": 895.338, + "y": 129.938, + "name": "parameter-int-training_epochs", "alignment": "left", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "e3f98e43-e04a-499e-b095-907932b77a18" + "fbdcb464-3d44-4e9e-b449-42f6bdc50113" ], "in": true, - "label": "shuffle" + "label": "training_epochs" }, { - "id": "8cc8aadb-133b-4861-9289-55bfebc41b26", + "id": "3872faa9-7a3d-4f8b-9721-860d0b6a0198", "type": "default", - "x": 637.438, - "y": 160.638, - "name": "parameter-out-Tuple[np.array, np.array]-train", + "x": 1129.663, + "y": 97.938, + "name": "parameter-out-keras.Sequential-trained_model", "alignment": "right", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", "links": [ - "358ed13e-c5c4-4731-a2b2-54402bce2b59", - "81e50653-c315-4f80-b309-420e1262c099" + "39614266-bfa1-463a-95d2-c659e6d4b65d" ], "in": false, - "label": "train" + "label": "trained_model" }, { - "id": "e71aac04-247d-479f-ae2c-4ff0f358cd22", + "id": "4d751236-407b-4b86-81e3-9950ad3be0d1", "type": "default", - "x": 637.438, - "y": 176.637, - "name": "parameter-out-Tuple[np.array, np.array]-test", + "x": 1129.663, + "y": 113.937, + "name": "parameter-out-dict-training_metrics", "alignment": "right", - "parentNode": "75fa2162-1bad-4b72-8730-8d0956d6d135", - "links": [ - "ee697d1e-0f3f-486c-a3ab-7c4171c257cd" - ], + "parentNode": "296fb807-ed24-4ede-8cc0-1928ed2e2ca4", + "links": [], "in": false, - "label": "test" + "label": "training_metrics" } ], - "name": "TrainTestSplit", - "color": "rgb(204,204,204)", + "name": "KerasTrainImageClassifier", + "color": "rgb(255,102,102)", "portsInOrder": [ - "5661aacd-aa08-45de-a48e-6cd562ffa19e", - "d26bdeed-84bb-4e23-9fa0-dcee3900c421", - "9594e3bf-0d9d-4a38-b8db-f40f1b08dfd6", - "e1bb025a-eae6-456f-b150-45a19571067f", - "27686323-6728-4ced-aaf0-aca277b73cfc" + "cbb76641-cc8f-4c9e-8f98-b5fdeca0ea1d", + "255c08ee-c1ce-433b-a743-16e62bf389bc", + "bb12b905-2f42-4b6d-a018-5f5095c0e186", + "6dd470d3-51ff-4e9c-8b75-395f4e278efc" ], "portsOutOrder": [ - "9913e11c-57eb-483c-8e6a-23889093e986", - "8cc8aadb-133b-4861-9289-55bfebc41b26", - "e71aac04-247d-479f-ae2c-4ff0f358cd22" + "e1ebc3bf-7f50-4322-bdf1-8aa96a3e83d5", + "3872faa9-7a3d-4f8b-9721-860d0b6a0198", + "4d751236-407b-4b86-81e3-9950ad3be0d1" ] }, - "b453af74-9e09-4dfa-8c26-906e314b4054": { - "id": "b453af74-9e09-4dfa-8c26-906e314b4054", + "b43dd065-51e2-4d7a-b249-2452e33e5f31": { + "id": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "type": "custom-node", "selected": false, "extras": { "type": "debug", - "path": "xai_components/xai_learning/training.py", - "description": "Loads a Keras image dataset or creates a dataset from a directory.\n\n### Reference:\n- Keras Model Applications: https://keras.io/api/datasets/\n\n##### inPorts:\n- dataset_name: Loads a Keras image dataset given a valid string \n (mnist / mnist fasion / cifar10 / cifar 100) OR \n creates a dataset object when given a valid dataset directory path. \n \n For the latter, the directory must have subdirectories and each \n subdirectory name will be treated as its own class.\n\n for example, when given a Literal String `DATASET`, the structure must be:\n working_dir/\n |- DATASET \n |- CLASS_1\n |- CLASS_2\n |- CLASS_3\n \n##### outPorts:\n- dataset: a dataset tuple\n- class_dict: dict of classes if not using IMAGENET.", + "path": "xai_components/xai_tensorflow_keras/training.py", + "description": "Evaluates a Keras model against a dataset\n\n##### inPorts:\n- model: a Keras model object.\n- eval_dataset: a dataset tuple with (X (data), Y (label)).\n\n##### outPorts:\n- metrics: dict which contains results of evaluation.", "lineNo": [ { - "lineno": 12, - "end_lineno": 147 + "lineno": 402, + "end_lineno": 434 } ], - "borderColor": "rgb(0,192,255)" + "borderColor": "rgb(0,192,255)", + "nextNode": "None" }, - "x": 192.046, - "y": 49.68, + "x": 1191.262, + "y": 100.105, "ports": [ { - "id": "0b139e93-dc50-40d6-a6e4-c277fef00e92", + "id": "414a7614-427e-4fbc-a191-53d6ef5d3ad8", "type": "default", - "x": 194.038, - "y": 76.813, + "x": 1192.85, + "y": 126.838, "name": "in-0", "alignment": "left", - "parentNode": "b453af74-9e09-4dfa-8c26-906e314b4054", + "parentNode": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "links": [ - "dcbe8363-6f08-44dd-b65c-7a4dd2e4d58c" + "f28c90f3-2f62-4ba8-ab88-7ca19f141822" ], "in": true, "label": "▶" }, { - "id": "c3c6dfdc-9d61-4c55-9a1a-4ab029c96b58", + "id": "5ffa7a50-3523-4e14-9134-127d5d7d9159", "type": "default", - "x": 400.225, - "y": 76.813, + "x": 1378.85, + "y": 126.838, "name": "out-0", "alignment": "right", - "parentNode": "b453af74-9e09-4dfa-8c26-906e314b4054", + "parentNode": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "links": [ - "e4926133-bd63-4a8c-b50d-8d72de8a7630" + "ac60e2a5-0b4f-4f20-b75f-c8dc6f174ae6" ], "in": false, "label": "▶" }, { - "id": "a5362c25-6cd5-4cbc-9be0-b18bb596b8ab", + "id": "0c3c8bda-9b78-4529-9a23-30e1df205854", "type": "default", - "x": 194.038, - "y": 92.813, - "name": "parameter-string-dataset_name", + "x": 1192.85, + "y": 142.838, + "name": "parameter-keras.Sequential-model", "alignment": "left", - "parentNode": "b453af74-9e09-4dfa-8c26-906e314b4054", + "parentNode": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "links": [ - "9888e63f-2a42-495a-8785-85625afafad5" + "39614266-bfa1-463a-95d2-c659e6d4b65d" ], "in": true, - "label": "★dataset_name" + "label": "★model" }, { - "id": "7248b068-b063-421b-9468-fcda7829fd46", + "id": "8492e5d5-def3-4412-a61e-b45794d88a6e", "type": "default", - "x": 400.225, - "y": 92.813, - "name": "parameter-out-Tuple[np.array, np.array]-dataset", - "alignment": "right", - "parentNode": "b453af74-9e09-4dfa-8c26-906e314b4054", + "x": 1192.85, + "y": 158.838, + "name": "parameter-Tuple[np.array, np.array]-eval_dataset", + "alignment": "left", + "parentNode": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "links": [ - "39074613-63a9-4f7f-bc3b-23a245fb6e46" + "ea7d26e8-d775-4a07-b971-9eadaf702b35" ], - "in": false, - "label": "dataset" + "in": true, + "label": "★eval_dataset" }, { - "id": "5a3766c4-e2b1-476b-9bfd-787111b1a353", + "id": "ec479771-1a0a-42d3-ad83-be66fbc08823", "type": "default", - "x": 400.225, - "y": 108.813, - "name": "parameter-out-dict-class_dict", + "x": 1378.85, + "y": 142.838, + "name": "parameter-out-Dict[str, str]-metrics", "alignment": "right", - "parentNode": "b453af74-9e09-4dfa-8c26-906e314b4054", + "parentNode": "b43dd065-51e2-4d7a-b249-2452e33e5f31", "links": [], "in": false, - "label": "class_dict" + "label": "metrics" } ], - "name": "ReadDataSet", - "color": "rgb(153,204,204)", + "name": "KerasEvaluateAccuracy", + "color": "rgb(255,204,0)", "portsInOrder": [ - "0b139e93-dc50-40d6-a6e4-c277fef00e92", - "a5362c25-6cd5-4cbc-9be0-b18bb596b8ab" + "414a7614-427e-4fbc-a191-53d6ef5d3ad8", + "0c3c8bda-9b78-4529-9a23-30e1df205854", + "8492e5d5-def3-4412-a61e-b45794d88a6e" ], "portsOutOrder": [ - "c3c6dfdc-9d61-4c55-9a1a-4ab029c96b58", - "7248b068-b063-421b-9468-fcda7829fd46", - "5a3766c4-e2b1-476b-9bfd-787111b1a353" + "5ffa7a50-3523-4e14-9134-127d5d7d9159", + "ec479771-1a0a-42d3-ad83-be66fbc08823" ] } } diff --git a/examples/KerasTransferLearning.xircuits b/examples/KerasTransferLearning.xircuits index f4f2de7b..3f12eb20 100644 --- a/examples/KerasTransferLearning.xircuits +++ b/examples/KerasTransferLearning.xircuits @@ -1208,7 +1208,7 @@ "selected": false, "extras": { "type": "eval", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Evaluate the accuracy of a Tensorflow Keras model using a Tensorflow\ndataset (`tensorflow.data.Dataset`)\n\n##### inPorts:\n- model: trained tensorflow keras model.\n- eval_dataset: dataset to evaluate. Instance of `tensorflow.data.Dataset`.\n\n##### outPorts:\n- metrics: `dict` model loss and accuracy.", "lineNo": [ { @@ -1308,7 +1308,7 @@ "selected": false, "extras": { "type": "train", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Trains a keras model.\n\n##### inPorts:\n- model: compiled model.\n- training data: tensorflow keras model compatible dataset\n- batch_size: `int` or `None`. Number of samples per gradient update.\n- epochs: `int` number of epochs to train the model.\n- kwargs: `dict` optional. Other `tf.model.fit` arguments.\n\n##### outPorts:\n- trained_model: trained tensoflow keras model.\n- training_metrics: `dict`, training metrics from training history.", "lineNo": [ { @@ -1467,7 +1467,7 @@ "selected": false, "extras": { "type": "debug", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Compiles a Tensorflow Keras model.\n\n##### References:\n- [Tensorflow Keras\nOptimizers](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers)\n- [Tensorflow Keras\nlosses](https://www.tensorflow.org/api_docs/python/tf/keras/losses)\n- [Tensorflow Keras\nMetrics](https://www.tensorflow.org/api_docs/python/tf/keras/metrics)\n- [Tensorflow Keras loss\nidentifier](https://www.tensorflow.org/api_docs/python/tf/keras/losses/get#expandable-1)\n\n##### inPorts:\n- model: tensorflow keras model to compile.\n- optimizer_identifier: `any`, valid tensorflow keras optimizer identifier,\ne.g, `adam` or `Adam` for default arguments, `{\"class_name\": \"Adam\",\n\"config\": {\"learning_rate\": 0.001}}` to specify keyword arguments.\n- loss_identifier: `any`, valid tensorflow keras loss identifier, e.g,\n`categorical_crossentropy` or `CategoricalCrossentropy` for a loss as a\n[function](https://www.tensorflow.org/api_docs/python/tf/keras/losses#functions_2),\nor a\n[class](https://www.tensorflow.org/api_docs/python/tf/keras/losses#classes_2),\n`{\"class_name\": \"CategoricalCrossentropy\", \"config\": {\"from_logits\": True}`\nto pass in keyword arguments. Check out the [identifier\ndocumentation](https://www.tensorflow.org/api_docs/python/tf/keras/losses/get#expandable-1)\nfor more details. \n- metrics: `list` list of metrics to be evaluated by the model during\ntraining and testing. Each metric should be a string of a metric identifier,\ne.g, ['accuracy', 'mse', ... ].\n\n##### outPorts:\n- compiled_model: compiled tensorflow keras model\n- model_config: `dict` model configuration.", "lineNo": [ { @@ -1611,7 +1611,7 @@ "selected": false, "extras": { "type": "model", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Fetch Tensorflow Keras Model by name, for transfer learning.\n\n##### Reference:\n- [Keras Application\nFunctions](https://www.tensorflow.org/api_docs/python/tf/keras/applications#functions_2)\n\n##### inPorts:\n- base_model_name: `str`, name of model (case sensitive). The\nbase_model_name must be listed under the functions\n[here](https://www.tensorflow.org/api_docs/python/tf/keras/applications#functions_2)\n- include_top: `bool`, whether to include the fully connected layers at\nthe top of the network. Defaults to `True`.\n- weights: `str` pretrained weights to use. Defaults to `imagenet`.\n- input_shape: `tuple` optional shape tuple, only to be specified if\ninclude_top is False (otherwise the input shape has to be (224, 224, 3)\n(with channels_last data format) or (3, 224, 224) (with channels_first\ndata format). It should have exactly 3 input channels, and width and\nheight should be no smaller than 32. E.g. (200, 200, 3) would be one\nvalid value.\n- freeze_all: `bool`, whether to freeze the weights in all layers of the\nbase model. Defaults to `True`.\n- fine_tune_from: `int`, base model layer to fine tune from. Example,\nsetting fine_tune_from=5 for a pretrained model with 25 layers will\nfreeze only the first 5 layers. This will only take effect if freeze_all\nis set to `False`. Defaults to `0` (freeze_all=True).\n- classes: `int` number of classes to classify images into, only to be\nspecified if `include_top` is `True`, and if no `weights` argument is\nspecified.\n- binary: `bool` whether this model will be used for binary classification.\nDefaults o `False`.\n- classifier_activation: `str` or `callable`. The activation function to\nuse on the \"top\" layer. Ignored unless `include_top=True`. Set\n`classifier_activation=None` to return the logits of the \"top\" layer.\nWhen loading pretrained weights, classifier_activation can only be None\nor \"softmax\".\n- kwargs: `dict`, optional. Passed to the model class. Please refer to the\nspecific tensorflow keras model documentation for other model specific\nkeyword arguments.\n\n##### outPorts:\n- model: tensorflow keras model.", "lineNo": [ { @@ -1824,7 +1824,7 @@ "selected": false, "extras": { "type": "debug", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Fetch Tensorflow Dataset by name\n\n##### Reference:\n- [Tensorflow Datasets\nCatalog](https://www.tensorflow.org/datasets/catalog/overview)\n\n##### inPorts:\n- dataset_name: `str`, name of dataset, as listed on [Tensorflow Datasets\ncatalog](https://www.tensorflow.org/datasets/catalog/overview)\n- batch_size: `int`, if set, add a batch dimension to the dataset.\nDefaults to `32`.\n- shuffle_files: `bool`, whether to shuffle the input files. Defaults to\n`False`.\n- as_supervised: `bool`, if `True`, the returned `tf.data.Dataset` will\nhave a 2-tuple structure `(input, label)` according to\n`builder.info.supervised_keys`. If `False`, the default, the returned\n`tf.data.Dataset` will have a dictionary with all the features.\n- kwargs: `dict`, optional. Passed to `tfds.load`. Please refer to the\nspecific tensorflow dataset documentation for other dataset specific\nkeyword arguments.\n\n##### outPorts:\n- all_data: `dict`, all available\ndataset.\n- train_data: `tf.data.Dataset`, train split if available\n- test_data: `tf.data.Dataset`, test split if available", "lineNo": [ { @@ -2024,7 +2024,7 @@ "selected": false, "extras": { "type": "debug", - "path": "xai_components/xai_learning/keras_transfer_learning.py", + "path": "xai_components/xai_tensorflow_keras/keras_transfer_learning.py", "description": "Saves a Tensorflow Keras model.\n\n##### inPorts:\n- model: tensorflow keras model to save\n- model_name: `str` name to save the model as\n ", "lineNo": [ { diff --git a/xai_components/readme.md b/xai_components/readme.md index fb3c6720..c89422f9 100644 --- a/xai_components/readme.md +++ b/xai_components/readme.md @@ -7,7 +7,7 @@ These components will always be included in the Xircuits installation. | Name | Description | | | -------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Learning | Deep learning related components using Tensorflow Keras. | [Link](https://github.com/XpressAI/xircuits/tree/master/xai_components/xai_learning) | +| Tensorflow Keras | Deep learning related components using Tensorflow Keras. | [Link](https://github.com/XpressAI/xircuits/tree/master/xai_components/xai_tensorflow_keras) | | Pytorch | Components that use Pytorch's ML library. | [Link](https://github.com/XpressAI/xircuits/tree/master/xai_components/xai_pytorch) | | Spark | Components built using the Pyspark library. Run these components with the Xircuits Remote Run! | [Link](https://github.com/XpressAI/xircuits/tree/master/xai_components/xai_spark) | | Template | Great components for new learners and to experiment outputs. | [Link](https://github.com/XpressAI/xircuits/tree/master/xai_components/xai_template) | diff --git a/xai_components/xai_learning/__init__.py b/xai_components/xai_tensorflow_keras/__init__.py similarity index 100% rename from xai_components/xai_learning/__init__.py rename to xai_components/xai_tensorflow_keras/__init__.py diff --git a/xai_components/xai_learning/keras_transfer_learning.py b/xai_components/xai_tensorflow_keras/keras_transfer_learning.py similarity index 99% rename from xai_components/xai_learning/keras_transfer_learning.py rename to xai_components/xai_tensorflow_keras/keras_transfer_learning.py index 0d4520a9..e96c9939 100644 --- a/xai_components/xai_learning/keras_transfer_learning.py +++ b/xai_components/xai_tensorflow_keras/keras_transfer_learning.py @@ -410,7 +410,7 @@ def execute(self, ctx): self.compiled_model.value = self.model.value model_config = { "lr": self.compiled_model.value.optimizer.lr.numpy().item(), - "optimizer_name": self.compiled_model.value.optimizer._name, + "optimizer_name": self.compiled_model.value.optimizer.name, "loss": self.compiled_model.value.loss, } diff --git a/xai_components/xai_learning/requirements.txt b/xai_components/xai_tensorflow_keras/requirements.txt similarity index 100% rename from xai_components/xai_learning/requirements.txt rename to xai_components/xai_tensorflow_keras/requirements.txt diff --git a/xai_components/xai_learning/tf_keras.py b/xai_components/xai_tensorflow_keras/tf_keras.py similarity index 100% rename from xai_components/xai_learning/tf_keras.py rename to xai_components/xai_tensorflow_keras/tf_keras.py diff --git a/xai_components/xai_learning/training.py b/xai_components/xai_tensorflow_keras/training.py similarity index 98% rename from xai_components/xai_learning/training.py rename to xai_components/xai_tensorflow_keras/training.py index d567cd89..e45ca8c9 100644 --- a/xai_components/xai_learning/training.py +++ b/xai_components/xai_tensorflow_keras/training.py @@ -9,7 +9,7 @@ from pathlib import Path @xai_component -class ReadDataSet(Component): +class ReadKerasDataSet(Component): """Loads a Keras image dataset or creates a dataset from a directory. ### Reference: @@ -244,7 +244,7 @@ def execute(self, ctx) -> None: self.done = True @xai_component -class Create1DInputModel(Component): +class KerasCreate1DInputModel(Component): """Takes a 1D dataset tuple and creates a 1D Keras model. ##### inPorts: @@ -283,7 +283,7 @@ def execute(self, ctx) -> None: self.done = True @xai_component -class Create2DInputModel(Component): +class KerasCreate2DInputModel(Component): """Takes a 2D dataset tuple and creates a 2D Keras model. ##### inPorts: @@ -332,10 +332,10 @@ def execute(self, ctx) -> None: optimizer='adam', metrics=['accuracy'] ) - + model_config = { 'lr': model.optimizer.lr.numpy().item(), - 'optimizer_name': model.optimizer._name, + 'optimizer_name': model.optimizer.name, 'loss': model.loss, } @@ -346,7 +346,7 @@ def execute(self, ctx) -> None: @xai_component -class TrainImageClassifier(Component): +class KerasTrainImageClassifier(Component): """Trains a Keras model for image classification. ##### inPorts: @@ -399,7 +399,7 @@ def execute(self, ctx) -> None: @xai_component -class EvaluateAccuracy(Component): +class KerasEvaluateAccuracy(Component): """Evaluates a Keras model against a dataset ##### inPorts: