diff --git a/apps/class-solid/src/components/PermutationSweepButton.tsx b/apps/class-solid/src/components/PermutationSweepButton.tsx deleted file mode 100644 index e5a40848..00000000 --- a/apps/class-solid/src/components/PermutationSweepButton.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import type { Config } from "@classmodel/class/config"; -import { - type PartialConfig, - mergeConfigurations, -} from "@classmodel/class/config_utils"; -import { type Sweep, performSweep } from "@classmodel/class/sweep"; -import { For, createSignal } from "solid-js"; -import { unwrap } from "solid-js/store"; -import { Button } from "~/components/ui/button"; -import { type Experiment, runExperiment, setExperiments } from "~/lib/store"; -import { - Dialog, - DialogContent, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "./ui/dialog"; - -function nameForPermutation(config: PartialConfig): string { - const chunks = []; - for (const [section, params] of Object.entries(config)) { - const paramChunks = []; - for (const [param, value] of Object.entries(params)) { - paramChunks.push(`${param}=${value}`); - } - // Add section? - chunks.push(paramChunks.join(",")); - } - return chunks.join(","); -} - -function config2permutation(reference: Config, config: PartialConfig): Config { - return { - ...mergeConfigurations(reference, config), - name: nameForPermutation(config), - description: "", - }; -} - -function configs2Permutations( - reference: Config, - configs: PartialConfig[], -): Config[] { - return configs.map((c) => config2permutation(reference, c)); -} - -export function PermutationSweepButton(props: { - experiment: Experiment; - experimentIndex: number; -}) { - const sweeps: Sweep[] = [ - { - section: "initialState", - parameter: "h_0", - start: 100, - step: 100, - steps: 5, - }, - { - section: "mixedLayer", - parameter: "beta", - start: 0.1, - step: 0.1, - steps: 5, - }, - ]; - - function addSweep() { - const configs = performSweep(sweeps); - const perms = configs2Permutations( - unwrap(props.experiment.config.reference), - configs, - ); - setOpen(false); - setExperiments(props.experimentIndex, "config", "permutations", perms); - runExperiment(props.experimentIndex); - } - const [open, setOpen] = createSignal(false); - return ( - - } - > - S - - - - - Perform a sweep over parameters - - -
-

- This will create a set of permutations, for combination of the - following parameters: -

-
    - - {(sweep) => ( -
  • - {sweep.section}.{sweep.parameter} from {sweep.start} with - increment of {sweep.step} for {sweep.steps} steps -
  • - )} -
    -
-
- - - -
-
- ); -} diff --git a/apps/class-solid/src/components/PermutationsList.tsx b/apps/class-solid/src/components/PermutationsList.tsx index 8a7b2071..608d9302 100644 --- a/apps/class-solid/src/components/PermutationsList.tsx +++ b/apps/class-solid/src/components/PermutationsList.tsx @@ -14,7 +14,6 @@ import { setPermutationConfigInExperiment, swapPermutationAndReferenceConfiguration, } from "~/lib/store"; -import { PermutationSweepButton } from "./PermutationSweepButton"; import { MdiCakeVariantOutline, MdiCog, @@ -303,10 +302,6 @@ export function PermutationsList(props: { experiment={props.experiment} experimentIndex={props.experimentIndex} /> -