Skip to content
Snippets Groups Projects
Commit 0c5b87c8 authored by pat-alt's avatar pat-alt
Browse files

anonymous functions causing some trouble with serialization

parent ac4b9ed7
No related branches found
No related tags found
1 merge request!7669 initial run including fmnist lenet and new method
......@@ -2,7 +2,7 @@
julia_version = "1.9.3"
manifest_format = "2.0"
project_hash = "d02f2655e27de24f6692fd688a43f5d4a28ee28f"
project_hash = "6d2faa27f9fe437fc49cbf54483df3f91bbcd105"
[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
......@@ -422,7 +422,7 @@ version = "2.2.1"
[[deps.ConformalPrediction]]
deps = ["CategoricalArrays", "ChainRules", "ComputationalResources", "Flux", "LazyArtifacts", "LinearAlgebra", "MLJBase", "MLJEnsembles", "MLJFlux", "MLJModelInterface", "MLUtils", "NaturalSort", "Plots", "ProgressMeter", "Random", "Serialization", "StatsBase", "Tables"]
path = "../../ConformalPrediction.jl"
git-tree-sha1 = "bd6c9678a6b98c024e2b615c9b04f9173f4feadf"
uuid = "98bfc277-1877-43dc-819b-a3e38c30242f"
version = "0.1.9"
......@@ -450,7 +450,7 @@ version = "0.6.2"
[[deps.CounterfactualExplanations]]
deps = ["CSV", "CUDA", "CategoricalArrays", "Chain", "ChainRulesCore", "DataFrames", "DecisionTree", "Distributions", "EvoTrees", "Flux", "LaplaceRedux", "LazyArtifacts", "LinearAlgebra", "MLDatasets", "MLJBase", "MLJDecisionTreeInterface", "MLJModels", "MLUtils", "MultivariateStats", "NearestNeighborModels", "PackageExtensionCompat", "Parameters", "Plots", "ProgressMeter", "Random", "Serialization", "SnoopPrecompile", "Statistics", "StatsBase", "Tables", "UMAP"]
path = "../../CounterfactualExplanations.jl"
git-tree-sha1 = "8393721ffa3c9be209a93eb154d0d9fe9ca187d5"
uuid = "2f13d31b-18db-44c1-bc43-ebaf2cff0be0"
version = "0.1.15"
......
......@@ -10,6 +10,7 @@ ECCCo = "0232c203-4013-4b0d-ad96-43e3e11ac3bf"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
JointEnergyModels = "48c56d24-211d-4463-bbc0-7a701b291131"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
MLJEnsembles = "50ed68f4-41fd-4504-931a-ed422449fee0"
MLJFlux = "094fc8d1-fd35-5302-93ea-dabda2abf845"
......
# Parallelization:
if "parallel" ARGS
@info "Running benchmarks in parallel."
import MPI
MPI.Init()
const PARALLEL = true
const PLZ = MPIParallelizer(MPI.COMM_WORLD)
else
@info "Running benchmarks sequentially."
const PARALLEL = false
const PLZ = nothing
end
include("setup_env.jl");
include("experiment.jl");
......@@ -20,7 +7,6 @@ if "run-all" in ARGS
else
datanames = [ARGS[findall(contains.(ARGS, "data="))] |> x -> replace(x, "data=" => "")]
end
datanames = ["linearly_separable", "moons", "circles", "mnist", "gmsc"]
# Linearly Separable
if "linearly_separable" in datanames
......
......@@ -17,12 +17,30 @@ using ECCCo
using Flux
using JointEnergyModels
using LazyArtifacts
using Logging
using MLJBase: multiclass_f1score, accuracy, multiclass_precision, table, machine, fit!
using MLJEnsembles
using MLJFlux
using Serialization
using TidierData
# Parallelization:
if "parallel" ARGS
@info "Running benchmarks in parallel."
import MPI
MPI.Init()
const PARALLEL = true
const PLZ = MPIParallelizer(MPI.COMM_WORLD)
if MPI.Comm_rank(MPI.COMM_WORLD) != 0
@info "Disabling logging on non-root processes."
global_logger(NullLogger())
end
else
@info "Running benchmarks sequentially."
const PARALLEL = false
const PLZ = nothing
end
# Constants:
const LATEST_VERSION = "1.8.5"
const ARTIFACT_NAME = "results-paper-submission-$(LATEST_VERSION)"
......
......@@ -42,12 +42,10 @@ function ECCCoGenerator(;
end
# Set size penalty
function _set_size_penalty(ce::AbstractCounterfactualExplanation)
return ECCCo.set_size_penalty(ce; κ=κ, temp=temp)
end
_set_size_penalty = (ce::AbstractCounterfactualExplanation) -> ECCCo.set_size_penalty(ce; κ=κ, temp=temp)
# Energy penalty
function _energy_penalty(ce::AbstractCounterfactualExplanation)
_energy_penalty = function (ce::AbstractCounterfactualExplanation)
if use_energy_delta
return ECCCo.energy_delta(ce; n=nsamples, nmin=nmin, kwargs...)
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment