diff --git a/Manifest.toml b/Manifest.toml index 474ab77857efef9045d5eccdb353e8957c6d7f23..71bc90dbc7c94c285ec915ef526c0e9895e8784a 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.8.5" manifest_format = "2.0" -project_hash = "6c93baa8c3f10fba4a90d0ac97b70baedd7f6bf4" +project_hash = "41a3f40f02d6284bd6f7e7949dbacd1fc92d63fd" [[deps.AbstractFFTs]] deps = ["ChainRulesCore", "LinearAlgebra"] @@ -58,6 +58,18 @@ version = "0.1.29" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +[[deps.AxisAlgorithms]] +deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] +git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7" +uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" +version = "1.0.1" + +[[deps.AxisArrays]] +deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"] +git-tree-sha1 = "1dd4d9f5beebac0c03446918741b1a03dc5e5788" +uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9" +version = "0.4.6" + [[deps.BFloat16s]] deps = ["LinearAlgebra", "Printf", "Random", "Test"] git-tree-sha1 = "a598ecb0d717092b5539dbbe890c98bac842b072" @@ -129,6 +141,12 @@ git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" version = "0.5.1" +[[deps.CatIndices]] +deps = ["CustomUnitRanges", "OffsetArrays"] +git-tree-sha1 = "a0f80a09780eed9b1d106a1bf62041c2efc995bc" +uuid = "aafaddc9-749c-510e-ac4f-586e18779b91" +version = "0.2.2" + [[deps.CategoricalArrays]] deps = ["DataAPI", "Future", "Missings", "Printf", "Requires", "Statistics", "Unicode"] git-tree-sha1 = "5084cc1a28976dd1642c9f337b28a3cb03e0f7d2" @@ -171,6 +189,12 @@ git-tree-sha1 = "d4e54b053fc584e7a0f37e9d3a5c4500927b343a" uuid = "78a364fa-1a3c-552a-b4bb-8fa0f9c1fcca" version = "0.10.3+0" +[[deps.Clustering]] +deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "Random", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "64df3da1d2a26f4de23871cd1b6482bb68092bd5" +uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +version = "0.14.3" + [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" @@ -256,6 +280,12 @@ git-tree-sha1 = "d05d9e7b7aedff4e5b51a029dced05cfb6125781" uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" version = "0.6.2" +[[deps.CoordinateTransformations]] +deps = ["LinearAlgebra", "StaticArrays"] +git-tree-sha1 = "681ea870b918e7cff7111da58791d7f718067a19" +uuid = "150eb455-5306-5404-9cee-2592286d6298" +version = "0.6.2" + [[deps.CounterfactualExplanations]] deps = ["CSV", "CUDA", "CategoricalArrays", "DataFrames", "Flux", "LaplaceRedux", "LazyArtifacts", "LinearAlgebra", "MLDatasets", "MLJBase", "MLJModels", "MLUtils", "MultivariateStats", "NearestNeighborModels", "Parameters", "PkgTemplates", "Plots", "ProgressMeter", "Random", "Serialization", "SliceMap", "Statistics", "StatsBase", "Tables", "UMAP"] path = "../CounterfactualExplanations.jl" @@ -267,6 +297,11 @@ git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.1.1" +[[deps.CustomUnitRanges]] +git-tree-sha1 = "1a3f97f907e6dd8983b744d2642651bb162a3f7a" +uuid = "dc8bdbbb-1ca9-579f-8c36-e416f6a65cce" +version = "1.0.2" + [[deps.DataAPI]] git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" @@ -382,6 +417,24 @@ git-tree-sha1 = "74faea50c1d007c85837327f6775bea60b5492dd" uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" version = "4.4.2+2" +[[deps.FFTViews]] +deps = ["CustomUnitRanges", "FFTW"] +git-tree-sha1 = "cbdf14d1e8c7c8aacbe8b19862e0179fd08321c2" +uuid = "4f61f5a4-77b1-5117-aa51-3ab5ef4ef0cd" +version = "0.3.2" + +[[deps.FFTW]] +deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] +git-tree-sha1 = "90630efff0894f8142308e334473eba54c433549" +uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +version = "1.5.0" + +[[deps.FFTW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c6033cc3892d0ef5bb9cd29b7f2f0331ea5184ea" +uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" +version = "3.3.10+0" + [[deps.FLoops]] deps = ["BangBang", "Compat", "FLoopsBase", "InitialValues", "JuliaVariables", "MLStyle", "Serialization", "Setfield", "Transducers"] git-tree-sha1 = "ffb97765602e3cbe59a0589d237bf07f245a8576" @@ -538,6 +591,12 @@ git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046" uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" version = "0.21.0+0" +[[deps.Ghostscript_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "43ba3d3c82c18d88471cfd2924931658838c9d8f" +uuid = "61579ee1-b43e-5ca0-a5da-69d92c66a64b" +version = "9.55.0+4" + [[deps.Glib_jll]] deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Pkg", "Zlib_jll"] git-tree-sha1 = "d3b3624125c1474292d0d8ed0f65554ac37ddb23" @@ -561,6 +620,12 @@ git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011" uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" version = "1.3.14+0" +[[deps.Graphs]] +deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "1cf1d7dcb4bc32d7b4a5add4232db3750c27ecb4" +uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" +version = "1.8.0" + [[deps.Grisu]] git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" @@ -602,24 +667,113 @@ git-tree-sha1 = "2e99184fca5eb6f075944b04c22edec29beb4778" uuid = "7869d1d1-7146-5819-86e3-90919afe41df" version = "0.4.7" +[[deps.ImageAxes]] +deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"] +git-tree-sha1 = "c54b581a83008dc7f292e205f4c409ab5caa0f04" +uuid = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac" +version = "0.6.10" + [[deps.ImageBase]] deps = ["ImageCore", "Reexport"] git-tree-sha1 = "b51bb8cae22c66d0f6357e3bcb6363145ef20835" uuid = "c817782e-172a-44cc-b673-b171935fbb9e" version = "0.1.5" +[[deps.ImageContrastAdjustment]] +deps = ["ImageCore", "ImageTransformations", "Parameters"] +git-tree-sha1 = "0d75cafa80cf22026cea21a8e6cf965295003edc" +uuid = "f332f351-ec65-5f6a-b3d1-319c6670881a" +version = "0.3.10" + [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" version = "0.9.4" +[[deps.ImageDistances]] +deps = ["Distances", "ImageCore", "ImageMorphology", "LinearAlgebra", "Statistics"] +git-tree-sha1 = "b1798a4a6b9aafb530f8f0c4a7b2eb5501e2f2a3" +uuid = "51556ac3-7006-55f5-8cb3-34580c88182d" +version = "0.2.16" + +[[deps.ImageFiltering]] +deps = ["CatIndices", "ComputationalResources", "DataStructures", "FFTViews", "FFTW", "ImageBase", "ImageCore", "LinearAlgebra", "OffsetArrays", "Reexport", "SnoopPrecompile", "SparseArrays", "StaticArrays", "Statistics", "TiledIteration"] +git-tree-sha1 = "f265e53558fbbf23e0d54e4fab7106c0f2a9e576" +uuid = "6a3955dd-da59-5b1f-98d4-e7296123deb5" +version = "0.7.3" + +[[deps.ImageIO]] +deps = ["FileIO", "IndirectArrays", "JpegTurbo", "LazyModules", "Netpbm", "OpenEXR", "PNGFiles", "QOI", "Sixel", "TiffImages", "UUIDs"] +git-tree-sha1 = "342f789fd041a55166764c351da1710db97ce0e0" +uuid = "82e4d734-157c-48bb-816b-45c225c6df19" +version = "0.6.6" + +[[deps.ImageMagick]] +deps = ["FileIO", "ImageCore", "ImageMagick_jll", "InteractiveUtils", "Libdl", "Pkg", "Random"] +git-tree-sha1 = "5bc1cb62e0c5f1005868358db0692c994c3a13c6" +uuid = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" +version = "1.2.1" + +[[deps.ImageMagick_jll]] +deps = ["Artifacts", "Ghostscript_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "124626988534986113cfd876e3093e4a03890f58" +uuid = "c73af94c-d91f-53ed-93a7-00f77d67a9d7" +version = "6.9.12+3" + +[[deps.ImageMetadata]] +deps = ["AxisArrays", "ImageAxes", "ImageBase", "ImageCore"] +git-tree-sha1 = "36cbaebed194b292590cba2593da27b34763804a" +uuid = "bc367c6b-8a6b-528e-b4bd-a4b897500b49" +version = "0.9.8" + +[[deps.ImageMorphology]] +deps = ["ImageCore", "LinearAlgebra", "Requires", "TiledIteration"] +git-tree-sha1 = "e7c68ab3df4a75511ba33fc5d8d9098007b579a8" +uuid = "787d08f9-d448-5407-9aad-5290dd7ab264" +version = "0.3.2" + +[[deps.ImageQualityIndexes]] +deps = ["ImageContrastAdjustment", "ImageCore", "ImageDistances", "ImageFiltering", "LazyModules", "OffsetArrays", "SnoopPrecompile", "Statistics"] +git-tree-sha1 = "5985d467623f106523ed8351f255642b5141e7be" +uuid = "2996bd0c-7a13-11e9-2da2-2f5ce47296a9" +version = "0.3.4" + +[[deps.ImageSegmentation]] +deps = ["Clustering", "DataStructures", "Distances", "Graphs", "ImageCore", "ImageFiltering", "ImageMorphology", "LinearAlgebra", "MetaGraphs", "RegionTrees", "SimpleWeightedGraphs", "StaticArrays", "Statistics"] +git-tree-sha1 = "36832067ea220818d105d718527d6ed02385bf22" +uuid = "80713f31-8817-5129-9cf8-209ff8fb23e1" +version = "1.7.0" + [[deps.ImageShow]] deps = ["Base64", "FileIO", "ImageBase", "ImageCore", "OffsetArrays", "StackViews"] git-tree-sha1 = "b563cf9ae75a635592fc73d3eb78b86220e55bd8" uuid = "4e3cecfd-b093-5904-9786-8bbb286a6a31" version = "0.3.6" +[[deps.ImageTransformations]] +deps = ["AxisAlgorithms", "ColorVectorSpace", "CoordinateTransformations", "ImageBase", "ImageCore", "Interpolations", "OffsetArrays", "Rotations", "StaticArrays"] +git-tree-sha1 = "8717482f4a2108c9358e5c3ca903d3a6113badc9" +uuid = "02fcd773-0e25-5acc-982a-7f6622650795" +version = "0.9.5" + +[[deps.Images]] +deps = ["Base64", "FileIO", "Graphics", "ImageAxes", "ImageBase", "ImageContrastAdjustment", "ImageCore", "ImageDistances", "ImageFiltering", "ImageIO", "ImageMagick", "ImageMetadata", "ImageMorphology", "ImageQualityIndexes", "ImageSegmentation", "ImageShow", "ImageTransformations", "IndirectArrays", "IntegralArrays", "Random", "Reexport", "SparseArrays", "StaticArrays", "Statistics", "StatsBase", "TiledIteration"] +git-tree-sha1 = "03d1301b7ec885b266c0f816f338368c6c0b81bd" +uuid = "916415d5-f1e6-5110-898d-aaa5f9f070e0" +version = "0.25.2" + +[[deps.Imath_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "87f7662e03a649cffa2e05bf19c303e168732d3e" +uuid = "905a6f67-0a94-5f89-b386-d35d92009cd1" +version = "3.1.2+0" + +[[deps.IndirectArrays]] +git-tree-sha1 = "012e604e1c7458645cb8b436f8fba789a51b257f" +uuid = "9b13fd28-a010-5f03-acff-a1bbcff69959" +version = "1.0.0" + [[deps.Inflate]] git-tree-sha1 = "5cd07aab533df5170988219191dfad0519391428" uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" @@ -641,6 +795,18 @@ git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" version = "1.4.0" +[[deps.IntegralArrays]] +deps = ["ColorTypes", "FixedPointNumbers", "IntervalSets"] +git-tree-sha1 = "be8e690c3973443bec584db3346ddc904d4884eb" +uuid = "1d092043-8f09-5a30-832f-7509e371ab51" +version = "0.1.5" + +[[deps.IntelOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "d979e54b71da82f3a65b62553da4fc3d18c9004c" +uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" +version = "2018.0.3+2" + [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" @@ -651,6 +817,18 @@ git-tree-sha1 = "eb05b5625bc5d821b8075a77e4c421933e20c76b" uuid = "7d512f48-7fb1-5a58-b986-67e6dc259f01" version = "0.7.0" +[[deps.Interpolations]] +deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] +git-tree-sha1 = "721ec2cf720536ad005cb38f50dbba7b02419a15" +uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +version = "0.14.7" + +[[deps.IntervalSets]] +deps = ["Dates", "Random", "Statistics"] +git-tree-sha1 = "16c0cc91853084cb5f58a78bd209513900206ce6" +uuid = "8197267c-284f-5f27-9208-e0e47529a953" +version = "0.7.4" + [[deps.InverseFunctions]] deps = ["Test"] git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f" @@ -667,6 +845,11 @@ git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.1.1" +[[deps.IterTools]] +git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.4.0" + [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" uuid = "82899510-4779-5014-852e-03e436cf321d" @@ -702,6 +885,12 @@ git-tree-sha1 = "84b10656a41ef564c39d2d477d7236966d2b5683" uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" version = "1.12.0" +[[deps.JpegTurbo]] +deps = ["CEnum", "FileIO", "ImageCore", "JpegTurbo_jll", "TOML"] +git-tree-sha1 = "106b6aa272f294ba47e96bd3acbabdc0407b5c60" +uuid = "b835a17e-a41a-41e7-81f0-2f016b05efe0" +version = "0.1.2" + [[deps.JpegTurbo_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "b53380851c6e6664204efb2e62cd24fa5c47e4ba" @@ -888,6 +1077,12 @@ git-tree-sha1 = "971be550166fe3f604d28715302b58a3f7293160" uuid = "23992714-dd62-5051-b70f-ba57cb901cac" version = "0.10.3" +[[deps.MKL_jll]] +deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] +git-tree-sha1 = "2ce8695e1e699b68702c03402672a69f54b8aca9" +uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" +version = "2022.2.0+0" + [[deps.MLDatasets]] deps = ["CSV", "Chemfiles", "DataDeps", "DataFrames", "DelimitedFiles", "FileIO", "FixedPointNumbers", "GZip", "Glob", "HDF5", "ImageShow", "JLD2", "JSON3", "LazyModules", "MAT", "MLUtils", "NPZ", "Pickle", "Printf", "Requires", "SparseArrays", "Tables"] git-tree-sha1 = "498b37aa3ebb4407adea36df1b244fa4e397de5e" @@ -966,6 +1161,12 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102" uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" version = "0.3.2" +[[deps.MetaGraphs]] +deps = ["Graphs", "JLD2", "Random"] +git-tree-sha1 = "1130dbe1d5276cb656f6e1094ce97466ed700e5a" +uuid = "626554b9-1ddb-594c-aa3c-2596fe9399a5" +version = "0.7.2" + [[deps.MicroCollections]] deps = ["BangBang", "InitialValues", "Setfield"] git-tree-sha1 = "4d5917a26ca33c66c8e5ca3247bd163624d35493" @@ -1068,6 +1269,12 @@ git-tree-sha1 = "2c3726ceb3388917602169bed973dbc97f1b51a8" uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" version = "0.4.13" +[[deps.Netpbm]] +deps = ["FileIO", "ImageCore", "ImageMetadata"] +git-tree-sha1 = "5ae7ca23e13855b3aba94550f26146c01d259267" +uuid = "f09324ee-3d7c-5217-9330-fc30815ba969" +version = "1.1.0" + [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" @@ -1095,6 +1302,18 @@ deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" version = "0.3.20+0" +[[deps.OpenEXR]] +deps = ["Colors", "FileIO", "OpenEXR_jll"] +git-tree-sha1 = "327f53360fdb54df7ecd01e96ef1983536d1e633" +uuid = "52e1d378-f018-4a11-a4be-720524705ac7" +version = "0.3.2" + +[[deps.OpenEXR_jll]] +deps = ["Artifacts", "Imath_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "923319661e9a22712f24596ce81c54fc0366f304" +uuid = "18a262bb-aa17-5467-a713-aee519bc75cb" +version = "3.1.1+0" + [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" @@ -1152,6 +1371,12 @@ git-tree-sha1 = "cf494dca75a69712a72b80bc48f59dcf3dea63ec" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" version = "0.11.16" +[[deps.PNGFiles]] +deps = ["Base64", "CEnum", "ImageCore", "IndirectArrays", "OffsetArrays", "libpng_jll"] +git-tree-sha1 = "f809158b27eba0c18c269cf2a2be6ed751d3e81d" +uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883" +version = "0.3.17" + [[deps.PaddedViews]] deps = ["OffsetArrays"] git-tree-sha1 = "03a7a85b76381a3d04c7a1656039197e70eda03d" @@ -1198,6 +1423,12 @@ git-tree-sha1 = "cb9adebf65c910acc75ef537d25791371d8339c6" uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1" version = "0.7.30" +[[deps.PkgVersion]] +deps = ["Pkg"] +git-tree-sha1 = "f6cf8e7944e50901594838951729a1861e668cb8" +uuid = "eebad327-c553-4316-9ea0-9fa01ccd7688" +version = "0.3.2" + [[deps.PlotThemes]] deps = ["PlotUtils", "Statistics"] git-tree-sha1 = "1f03a2d339f42dca4a4da149c7e15e9b896ad899" @@ -1212,9 +1443,9 @@ version = "1.3.4" [[deps.Plots]] deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "Preferences", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SnoopPrecompile", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "Unzip"] -git-tree-sha1 = "87036ff7d1277aa624ce4d211ddd8720116f80bf" +git-tree-sha1 = "8ac949bd0ebc46a44afb1fdca1094554a84b086e" uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.38.4" +version = "1.38.5" [[deps.PooledArrays]] deps = ["DataAPI", "Future"] @@ -1260,6 +1491,12 @@ git-tree-sha1 = "d7a7aef8f8f2d537104f170139553b14dfe39fe9" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" version = "1.7.2" +[[deps.QOI]] +deps = ["ColorTypes", "FileIO", "FixedPointNumbers"] +git-tree-sha1 = "18e8f4d1426e965c7b532ddd260599e1510d26ce" +uuid = "4b34888f-f399-49d4-9bb3-47ed5cae4e65" +version = "1.0.0" + [[deps.Qt5Base_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] git-tree-sha1 = "0c03844e2231e12fda4d0086fd7cbe4098ee8dc5" @@ -1272,6 +1509,12 @@ git-tree-sha1 = "de191bc385072cc6c7ed3ffdc1caeed3f22c74d4" uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" version = "2.7.0" +[[deps.Quaternions]] +deps = ["LinearAlgebra", "Random", "RealDot"] +git-tree-sha1 = "da095158bdc8eaccb7890f9884048555ab771019" +uuid = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0" +version = "0.7.4" + [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -1292,6 +1535,17 @@ git-tree-sha1 = "043da614cc7e95c703498a491e2c21f58a2b8111" uuid = "e6cf234a-135c-5ec9-84dd-332b85af5143" version = "1.5.3" +[[deps.RangeArrays]] +git-tree-sha1 = "b9039e93773ddcfc828f12aadf7115b4b4d225f5" +uuid = "b3c3ace0-ae52-54e7-9d0b-2c1406fd6b9d" +version = "0.3.2" + +[[deps.Ratios]] +deps = ["Requires"] +git-tree-sha1 = "dc84268fe0e3335a62e315a3a7cf2afa7178a734" +uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" +version = "0.4.3" + [[deps.RealDot]] deps = ["LinearAlgebra"] git-tree-sha1 = "9f0a1b71baaf7650f4fa8a1d168c7fb6ee41f0c9" @@ -1315,6 +1569,12 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" version = "1.2.2" +[[deps.RegionTrees]] +deps = ["IterTools", "LinearAlgebra", "StaticArrays"] +git-tree-sha1 = "4618ed0da7a251c7f92e869ae1a19c74a7d2a7f9" +uuid = "dee08c22-ab7f-5625-9660-a9af2021b33f" +version = "0.3.2" + [[deps.RelocatableFolders]] deps = ["SHA", "Scratch"] git-tree-sha1 = "90bc7a7c96410424509e4263e277e43250c05691" @@ -1339,6 +1599,12 @@ git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" version = "0.4.0+0" +[[deps.Rotations]] +deps = ["LinearAlgebra", "Quaternions", "Random", "StaticArrays", "Statistics"] +git-tree-sha1 = "9480500060044fd25a1c341da53f34df7443c2f2" +uuid = "6038ab10-8711-5258-84ad-4b1120ba62dc" +version = "1.3.4" + [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" version = "0.7.0" @@ -1401,6 +1667,18 @@ git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" version = "0.9.4" +[[deps.SimpleWeightedGraphs]] +deps = ["Graphs", "LinearAlgebra", "Markdown", "SparseArrays", "Test"] +git-tree-sha1 = "a8d28ad975506694d59ac2f351e29243065c5c52" +uuid = "47aef6b3-ad0c-573a-a1e2-d07658019622" +version = "1.2.2" + +[[deps.Sixel]] +deps = ["Dates", "FileIO", "ImageCore", "IndirectArrays", "OffsetArrays", "REPL", "libsixel_jll"] +git-tree-sha1 = "8fb59825be681d451c246a795117f317ecbcaa28" +uuid = "45858cf5-a6b0-47a3-bbea-62219f50df47" +version = "0.1.2" + [[deps.SliceMap]] deps = ["ForwardDiff", "JuliennedArrays", "StaticArrays", "Tracker", "ZygoteRules"] git-tree-sha1 = "f988004407ccf6c398a87914eafdd8bc9109e533" @@ -1548,6 +1826,18 @@ version = "0.1.1" deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +[[deps.TiffImages]] +deps = ["ColorTypes", "DataStructures", "DocStringExtensions", "FileIO", "FixedPointNumbers", "IndirectArrays", "Inflate", "Mmap", "OffsetArrays", "PkgVersion", "ProgressMeter", "UUIDs"] +git-tree-sha1 = "7e6b0e3e571be0b4dd4d2a9a3a83b65c04351ccc" +uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69" +version = "0.6.3" + +[[deps.TiledIteration]] +deps = ["OffsetArrays"] +git-tree-sha1 = "5683455224ba92ef59db72d10690690f4a8dc297" +uuid = "06e1c1a7-607b-532d-9fad-de7d9aa2abac" +version = "0.3.1" + [[deps.TimerOutputs]] deps = ["ExprTools", "Printf"] git-tree-sha1 = "f2fd3f288dfc6f507b0c3a2eb3bac009251e548b" @@ -1641,6 +1931,12 @@ git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23" uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" version = "1.4.2" +[[deps.WoodburyMatrices]] +deps = ["LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "de67fa59e33ad156a590055375a30b23c40299d3" +uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" +version = "0.5.5" + [[deps.WorkerUtilities]] git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7" uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" @@ -1848,6 +2144,12 @@ git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c" uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" version = "1.6.38+0" +[[deps.libsixel_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "libpng_jll"] +git-tree-sha1 = "d4f63314c8aa1e48cd22aa0c17ed76cd1ae48c3c" +uuid = "075b6546-f08a-558a-be8f-8157d0f608a5" +version = "1.10.3+0" + [[deps.libvorbis_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] git-tree-sha1 = "b910cb81ef3fe6e78bf6acee440bda86fd6ae00c" diff --git a/Project.toml b/Project.toml index 620a1b286f9b7d6e3c9bd19b61c9094181992036..a9075c0e94158b7f97baa9ce1949ac7a06be9ccc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,7 @@ [deps] ConformalPrediction = "98bfc277-1877-43dc-819b-a3e38c30242f" CounterfactualExplanations = "2f13d31b-18db-44c1-bc43-ebaf2cff0be0" +Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" +MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458" MLJFlux = "094fc8d1-fd35-5302-93ea-dabda2abf845" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" diff --git a/_quarto.yml b/_quarto.yml index 4fbdb5b4369b09013df7cbcac2d963766f292253..c178089db4e97097b89cc83bb4a04870ef3c9357 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -6,5 +6,10 @@ bibliography: bib.bib format: julia-html: default +execute: + echo: false + eval: false + output: false + diff --git a/dev/proposal.ipynb b/dev/proposal.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..1a03e4c49f7a783d9d212e1e315a5c74ab65ffff --- /dev/null +++ b/dev/proposal.ipynb @@ -0,0 +1,174 @@ +{ + "cells": [ + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "---\n", + "title: Conformal Counterfactual Explanations\n", + "subtitle: Research Proposal\n", + "abstract: |\n", + " We propose Conformal Counterfactual Explanations: an effortless and rigorous way to produce realistic and faithful Counterfactual Explanations using Conformal Prediction. To address the need for realistic counterfactuals, existing work has primarily relied on separate generative models to learn the data generating process. While this an effective way to produce plausible and model-agnostic counterfactual explanations, it not only introduces an significant engineering overhead, but also reallocates the task of creating realistic model explanations from the model itsel to the generative model. Recent work has shown that there is no need for any of this when working with probabilistic models that explicitly quantify their own uncertainty. Unfortunately, most models used in practice still do not fulfil that basic requirement, in which case we would like to have a way to quantify predictive uncertainty in a post-hoc fashion.\n", + "---" + ], + "id": "74a21809" + }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "using CounterfactualExplanations\n", + "using CounterfactualExplanations.Data: load_mnist\n", + "using CounterfactualExplanations.Models: load_mnist_mlp\n", + "using Images\n", + "using MLDatasets\n", + "using MLDatasets: convert2image\n", + "using Plots" + ], + "id": "274dc69a", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Motivation\n", + "\n", + "Counterfactual Explanations are a powerful, flexible and intuitive way to not only explain black-box models, but also enable affected individuals to challenge them though the means of Algorithmic Recourse. \n", + "\n", + "### From Adversarial Examples to Counterfactual Explanations\n", + "\n", + "Most state-of-the-art approaches to generating Counterfactual Explanations (CE) rely on gradient descent in the feature space. The key idea is to perturb inputs $x\\in\\mathcal{X}$ into a black-box model $f: \\mathcal{X} \\mapsto \\mathcal{Y}$ in order to change the model output $f(x)$ to some pre-specified target value $t\\in\\mathcal{Y}$. Formally, this boils down to defining some loss function $\\ell(f(x),t)$ and taking gradient steps in the minimizing direction. The so generated counterfactuals are considered valid as soon as the predicted label matches the target label. A stripped down counterfactual explanation is therefore little different from an adversarial example.\n", + "\n", + "> You may not like it, but this is what counterfactuals look like\n" + ], + "id": "17241786" + }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "# Data:\n", + "counterfactual_data = load_mnist()\n", + "X, y = CounterfactualExplanations.DataPreprocessing.unpack_data(counterfactual_data)\n", + "input_dim, n_obs = size(counterfactual_data.X)\n", + "M = load_mnist_mlp()\n", + "\n", + "# Target:\n", + "factual_label = 8\n", + "x = reshape(X[:,rand(findall(predict_label(M, counterfactual_data).==factual_label))],input_dim,1)\n", + "target = 3\n", + "factual = predict_label(M, counterfactual_data, x)[1]\n", + "\n", + "# Search:\n", + "n_ce = 3\n", + "generator = GenericGenerator()\n", + "ces = generate_counterfactual(x, target, counterfactual_data, M, generator; num_counterfactuals=n_ce)" + ], + "id": "7351f8c8", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "image_size = 300\n", + "p1 = plot(\n", + " convert2image(MNIST, reshape(x,28,28)),\n", + " axis=nothing, \n", + " size=(image_size, image_size),\n", + " title=\"Factual\"\n", + ")\n", + "plts = [p1]\n", + "\n", + "for i in eachindex(ces)\n", + " ce = ces[i]\n", + " plt = plot(\n", + " convert2image(MNIST, reshape(CounterfactualExplanations.counterfactual(ce),28,28)),\n", + " axis=nothing, \n", + " size=(image_size, image_size),\n", + " title=\"Counterfactual $i\"\n", + " )\n", + " plts = [plts..., plt]\n", + "end\n", + "\n", + "plt = plot(plts...; size=(image_size * (n_ce + 1),image_size), layout=(1,(n_ce + 1)))" + ], + "id": "a1853fa9", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The crucial difference between adversarial examples and counterfactuals is one of intent. While adversarial examples are typically intened to go unnoticed, counterfactuals in the context of Explainable AI are generally sought to be \"plausible\" or \"realistic\". To fulfill this latter goal, researchers have come up with a myriad of ways. @joshi2019realistic were among the first to suggest that instead of searching counterfactuals in the feature space, we can instead traverse a latent embedding learned by a surrogate generative model. This ensures that the generated counterfactuals comply with the (learned) data-generating process (DGB). Similarly, @poyiadzi2020face use density ...\n", + "\n", + "- Show DiCE for weak MLP\n", + "- Show Latent for same weak MLP\n", + "- Latent can be manipulated: \n", + " - train biased model\n", + " - train VAE with biased variable removed/attacked (use Boston housing dataset)\n", + " - hypothesis: will generate bias-free explanations\n", + "\n", + "::: {#prp-surrogate}\n", + "\n", + "## Avoid Surrogates\n", + "\n", + "Since we are in the business of explaining a black-box model, the task of learning realistic representations of the data should not be reallocated from the model itself to some surrogate model.\n", + "\n", + ":::\n", + "\n", + "## Introduction to Conformal Prediction\n", + "\n", + "- distribution-free, model-agnostic and scalable approach to predictive uncertainty quantification\n", + "\n", + "### Post-hoc\n", + "\n", + "- Take any fitted model and turn it into a conformal model using calibration data.\n", + "\n", + "### Intrinsic --- Conformal Training [MAYBE]\n", + "\n", + "- Model explicitly trained for conformal prediction.\n", + "\n", + "## Conformal Counterfactuals\n", + "\n", + "- Realistic counterfactuals by minimizing predictive uncertainty [@schut2021generating].\n", + "- Problem: restricted to Bayesian models.\n", + "- Solution: post-hoc predictive uncertainty quantification. \n", + "- Conformal prediction is instance-based. So is CE. \n", + "- Does the coverage guarantee carry over to counterfactuals?\n", + "\n", + "### Research Questions\n", + "\n", + "- Is CP alone enough to ensure realistic counterfactuals?\n", + "- Do counterfactuals improve further as the models get better?\n", + "- Do counterfactuals get more realistic as coverage\n", + "- What happens as we vary coverage and setsize?\n", + "- What happens as we improve the model robustness?\n", + "- What happens as we improve the model's ability to incorporate predictive uncertainty (deep ensemble, laplace)?\n", + "\n", + "## Experiments\n", + "\n", + "- Maybe: conformalised Laplace\n", + "- Benchmarking:\n", + " - add PROBE into the mix\n", + " - compare travel costs to domain shits.\n", + "\n", + "## References\n" + ], + "id": "8abba11d" + } + ], + "metadata": { + "kernelspec": { + "name": "julia-(4-threads)-1.8", + "language": "julia", + "display_name": "Julia (4 threads) 1.8.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/dev/proposal.qmd b/dev/proposal.qmd index 8789e5a08d4a0b6c2674a1f5ceb2f4b74a267059..e641c830b720f7477e8b6025f2ca04fcefd4aec0 100644 --- a/dev/proposal.qmd +++ b/dev/proposal.qmd @@ -5,16 +5,71 @@ abstract: | We propose Conformal Counterfactual Explanations: an effortless and rigorous way to produce realistic and faithful Counterfactual Explanations using Conformal Prediction. To address the need for realistic counterfactuals, existing work has primarily relied on separate generative models to learn the data generating process. While this an effective way to produce plausible and model-agnostic counterfactual explanations, it not only introduces an significant engineering overhead, but also reallocates the task of creating realistic model explanations from the model itsel to the generative model. Recent work has shown that there is no need for any of this when working with probabilistic models that explicitly quantify their own uncertainty. Unfortunately, most models used in practice still do not fulfil that basic requirement, in which case we would like to have a way to quantify predictive uncertainty in a post-hoc fashion. --- +```{julia} +using CounterfactualExplanations +using CounterfactualExplanations.Data: load_mnist +using CounterfactualExplanations.Models: load_mnist_mlp +using Images +using MLDatasets +using MLDatasets: convert2image +using Plots +``` + ## Motivation Counterfactual Explanations are a powerful, flexible and intuitive way to not only explain black-box models, but also enable affected individuals to challenge them though the means of Algorithmic Recourse. ### From Adversarial Examples to Counterfactual Explanations -Most state-of-the-art approaches to generating Counterfactual Explanations (CE) rely on gradient descent in the feature space. The key idea is to perturb inputs $x\in\mathcal{X}$ into a black-box model $f: \mathcal{X} \mapsto \mathcal{Y}$ in order to change the model output $f(x)$ to some pre-specified target value $t\in\mathcal{Y}$. Formally, this boils down to defining some loss function $\ell(f(x),t)$ and taking gradient steps in the minimizing direction. The so generated counterfactuals are considered valid as soon as the predicted label matches the target label. A stripped down counterfactual is therefore little different from Adversarial Examples [@goodfellow2014explaining]. +Most state-of-the-art approaches to generating Counterfactual Explanations (CE) rely on gradient descent in the feature space. The key idea is to perturb inputs $x\in\mathcal{X}$ into a black-box model $f: \mathcal{X} \mapsto \mathcal{Y}$ in order to change the model output $f(x)$ to some pre-specified target value $t\in\mathcal{Y}$. Formally, this boils down to defining some loss function $\ell(f(x),t)$ and taking gradient steps in the minimizing direction. The so generated counterfactuals are considered valid as soon as the predicted label matches the target label. A stripped down counterfactual explanation is therefore little different from an adversarial example. > You may not like it, but this is what counterfactuals look like +```{julia} +# Data: +counterfactual_data = load_mnist() +X, y = CounterfactualExplanations.DataPreprocessing.unpack_data(counterfactual_data) +input_dim, n_obs = size(counterfactual_data.X) +M = load_mnist_mlp() + +# Target: +factual_label = 8 +x = reshape(X[:,rand(findall(predict_label(M, counterfactual_data).==factual_label))],input_dim,1) +target = 3 +factual = predict_label(M, counterfactual_data, x)[1] + +# Search: +n_ce = 3 +generator = GenericGenerator() +ces = generate_counterfactual(x, target, counterfactual_data, M, generator; num_counterfactuals=n_ce) +``` + +```{julia} +image_size = 300 +p1 = plot( + convert2image(MNIST, reshape(x,28,28)), + axis=nothing, + size=(image_size, image_size), + title="Factual" +) +plts = [p1] + +for i in eachindex(ces) + ce = ces[i] + plt = plot( + convert2image(MNIST, reshape(CounterfactualExplanations.counterfactual(ce),28,28)), + axis=nothing, + size=(image_size, image_size), + title="Counterfactual $i" + ) + plts = [plts..., plt] +end + +plt = plot(plts...; size=(image_size * (n_ce + 1),image_size), layout=(1,(n_ce + 1))) +``` + +The crucial difference between adversarial examples and counterfactuals is one of intent. While adversarial examples are typically intened to go unnoticed, counterfactuals in the context of Explainable AI are generally sought to be "plausible" or "realistic". To fulfill this latter goal, researchers have come up with a myriad of ways. @joshi2019realistic were among the first to suggest that instead of searching counterfactuals in the feature space, we can instead traverse a latent embedding learned by a surrogate generative model. This ensures that the generated counterfactuals comply with the (learned) data-generating process (DGB). Similarly, @poyiadzi2020face use density ... + - Show DiCE for weak MLP - Show Latent for same weak MLP - Latent can be manipulated: @@ -22,6 +77,14 @@ Most state-of-the-art approaches to generating Counterfactual Explanations (CE) - train VAE with biased variable removed/attacked (use Boston housing dataset) - hypothesis: will generate bias-free explanations +::: {#prp-surrogate} + +## Avoid Surrogates + +Since we are in the business of explaining a black-box model, the task of learning realistic representations of the data should not be reallocated from the model itself to some surrogate model. + +::: + ## Introduction to Conformal Prediction - distribution-free, model-agnostic and scalable approach to predictive uncertainty quantification