Skip to content

Commit

Permalink
added local opt problem
Browse files Browse the repository at this point in the history
  • Loading branch information
samyhaff committed May 8, 2024
1 parent de57cf3 commit 3f16756
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub enum Problem {
PoleBalancing,
Proben1Train,
Proben1Test,
LocalOpt,
}

#[derive(Debug)]
Expand All @@ -42,6 +43,7 @@ impl Benchmark {
Problem::Half => Benchmark::SphereClassification(half()),
Problem::Quarter => Benchmark::SphereClassification(quarter()),
Problem::TwoQuarters => Benchmark::SphereClassification(two_quarters()),
Problem::LocalOpt => Benchmark::SphereClassification(local_opt()),
Problem::Square => Benchmark::SphereClassification(square()),
Problem::Cube => Benchmark::SphereClassification(cube()),
Problem::Xor => Benchmark::Classification(xor()),
Expand Down Expand Up @@ -156,6 +158,15 @@ fn two_quarters() -> LabeledPoints {
.collect::<LabeledPoints>()
}

fn local_opt() -> LabeledPoints {
(0..POLE_BALANCING_STEPS)
.map(|i| {
let angle = 2. * PI * i as f64 / POLE_BALANCING_STEPS as f64;
(vec![1., angle], angle <= PI / 3. || (angle >= 2. * PI / 3. && angle <= PI) || (angle >= 4. * PI / 3. && angle <= 11. * PI / 6.))
})
.collect::<LabeledPoints>()
}

fn square() -> LabeledPoints {
vec![
(vec![1., PI / 4.], false),
Expand Down
32 changes: 32 additions & 0 deletions testing_job.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

#### General options
### -- specify queue --
#BSUB -q hpc
### -- set the job Name --
#BSUB -J Neuroevolution_testing
### -- ask for number of cores (default: 1) --
#BSUB -n 10
### -- specify that the cores must be on the same host --
#BSUB -R "span[hosts=1]"
### -- specify that we need 4GB of memory per core/slot --
#BSUB -R "rusage[mem=4GB]"
### -- specify that we want the job to get killed if it exceeds 5 GB per core/slot --
#BSUB -M 5GB
### -- set walltime limit: hh:mm --
#BSUB -W 24:00
### -- set the email address --
# please uncomment the following line and put in your e-mail address,
# if you want to receive e-mail notifications on a non-default address
#BSUB -u [email protected]
### -- send notification at start --
#BSUB -B
### -- send notification at completion --
#BSUB -N
### -- Specify the output and error file. %J is the job-id --
### -- -o and -e mean append, -oo and -eo mean overwrite --
#BSUB -o ~/Output_%J.out
#BSUB -e ~/Output_%J.err

cd ~/code-master
cargo run -- oneplusonena half -i 500 -t 1000 -o oneplusonena_half_500_1

0 comments on commit 3f16756

Please sign in to comment.