Skip to content

Commit 1140d06

Browse files
committed
Merge branch 'develop'
2 parents 4fd2bbc + 387facd commit 1140d06

File tree

5 files changed

+29
-49
lines changed

5 files changed

+29
-49
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rayon = "1.11.0"
7171
smallvec = { version = "1.13", features = ["serde"] }
7272
thiserror = "2.0.17"
7373
serde = { version = "1.0.228", features = ["derive", "rc"] }
74-
serde_json = { version = "1.0.143" }
74+
serde_json = { version = "1.0.148" }
7575
chrono = { version = "0.4.42", default-features = false, features = ["std"] }
7676
chrono-tz = "0.10"
7777
compact_str = { version = "0.9.0" }
@@ -81,7 +81,7 @@ slotmap = "1.0"
8181
hashbrown = { version = "0.16.1" }
8282
crossterm = "0.29"
8383
ratatui = { version = "0.29", default-features = false, features = ["crossterm"] }
84-
tui-piechart = "0.2.7"
84+
tui-piechart = "0.2.8"
8585
color-eyre = "0.6.3"
8686
tracing = "0.1.44"
8787
tracing-subscriber = { version = "0.3.22", features = ["env-filter", "fmt"] }

crates/radiate-engines/src/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub struct EngineIterator<E>
7474
where
7575
E: Engine,
7676
{
77-
pub(crate) engine: E,
77+
engine: E,
7878
control: Option<EngineControl>,
7979
}
8080

crates/radiate-gp/src/collections/graphs/codec.rs

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,18 @@ pub struct GraphCodec<T> {
88
template: GraphChromosome<T>,
99
}
1010

11-
impl<T> GraphCodec<T> {
11+
impl<T: Clone + Default> GraphCodec<T> {
1212
pub fn new(
1313
template: impl IntoIterator<Item = GraphNode<T>>,
1414
store: impl Into<NodeStore<T>>,
15-
) -> Self
16-
where
17-
T: Clone + Default,
18-
{
15+
) -> Self {
1916
GraphCodec {
2017
store: store.into(),
2118
template: template.into_iter().collect(),
2219
}
2320
}
2421

25-
pub fn directed(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self
26-
where
27-
T: Clone + Default,
28-
{
22+
pub fn directed(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self {
2923
let new_store = store.into();
3024

3125
GraphCodec {
@@ -36,10 +30,11 @@ impl<T> GraphCodec<T> {
3630
}
3731
}
3832

39-
pub fn recurrent(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self
40-
where
41-
T: Clone + Default,
42-
{
33+
pub fn recurrent(
34+
input_size: usize,
35+
output_size: usize,
36+
store: impl Into<NodeStore<T>>,
37+
) -> Self {
4338
let new_store = store.into();
4439

4540
GraphCodec {
@@ -54,10 +49,7 @@ impl<T> GraphCodec<T> {
5449
input_size: usize,
5550
output_size: usize,
5651
store: impl Into<NodeStore<T>>,
57-
) -> Self
58-
where
59-
T: Clone + Default,
60-
{
52+
) -> Self {
6153
let new_store = store.into();
6254

6355
GraphCodec {
@@ -72,10 +64,7 @@ impl<T> GraphCodec<T> {
7264
input_size: usize,
7365
output_size: usize,
7466
store: impl Into<NodeStore<T>>,
75-
) -> Self
76-
where
77-
T: Clone + Default,
78-
{
67+
) -> Self {
7968
let new_store = store.into();
8069

8170
GraphCodec {
@@ -86,10 +75,7 @@ impl<T> GraphCodec<T> {
8675
}
8776
}
8877

89-
pub fn lstm(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self
90-
where
91-
T: Clone + Default,
92-
{
78+
pub fn lstm(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self {
9379
let new_store = store.into();
9480

9581
GraphCodec {
@@ -100,10 +86,7 @@ impl<T> GraphCodec<T> {
10086
}
10187
}
10288

103-
pub fn gru(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self
104-
where
105-
T: Clone + Default,
106-
{
89+
pub fn gru(input_size: usize, output_size: usize, store: impl Into<NodeStore<T>>) -> Self {
10790
let new_store = store.into();
10891

10992
GraphCodec {
@@ -120,10 +103,7 @@ impl<T> GraphCodec<T> {
120103
rows: usize,
121104
cols: usize,
122105
store: impl Into<NodeStore<T>>,
123-
) -> Self
124-
where
125-
T: Clone + Default,
126-
{
106+
) -> Self {
127107
let new_store = store.into();
128108

129109
GraphCodec {

crates/radiate-gp/src/collections/trees/mutator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::TreeChromosome;
2-
use radiate_core::{AlterResult, Mutate, Rate, random_provider};
2+
use radiate_core::{AlterResult, Mutate, Rate, Valid, random_provider};
33

44
#[derive(Clone, Debug)]
55
pub struct HoistMutator {
@@ -9,9 +9,9 @@ pub struct HoistMutator {
99
impl HoistMutator {
1010
pub fn new(rate: impl Into<Rate>) -> Self {
1111
let rate = rate.into();
12-
// if !(0.0..=1.0).contains(&rate.0) {
13-
// panic!("rate must be between 0.0 and 1.0");
14-
// }
12+
if !rate.is_valid() {
13+
panic!("rate {:?} is not valid", rate);
14+
}
1515

1616
HoistMutator { rate }
1717
}

crates/radiate-python/src/names.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ pub(crate) const POLYNOMIAL_MUTATOR: &str = "PolynomialMutator";
4848
pub(crate) const JITTER_MUTATOR: &str = "JitterMutator";
4949

5050
// Events
51-
pub const START_EVENT: &str = "start_event";
52-
pub const STOP_EVENT: &str = "stop_event";
53-
pub const EPOCH_START_EVENT: &str = "epoch_start_event";
54-
pub const EPOCH_COMPLETE_EVENT: &str = "epoch_complete_event";
55-
pub const ENGINE_IMPROVEMENT_EVENT: &str = "engine_improvement_event";
51+
pub(crate) const START_EVENT: &str = "start_event";
52+
pub(crate) const STOP_EVENT: &str = "stop_event";
53+
pub(crate) const EPOCH_START_EVENT: &str = "epoch_start_event";
54+
pub(crate) const EPOCH_COMPLETE_EVENT: &str = "epoch_complete_event";
55+
pub(crate) const ENGINE_IMPROVEMENT_EVENT: &str = "engine_improvement_event";
5656

5757
// Loss Functions
58-
pub const MSE_LOSS: &str = "mse";
59-
pub const MAE_LOSS: &str = "mae";
60-
pub const CROSS_ENTROPY_LOSS: &str = "cross_entropy";
61-
pub const DIFF_LOSS: &str = "diff";
58+
pub(crate) const MSE_LOSS: &str = "mse";
59+
pub(crate) const MAE_LOSS: &str = "mae";
60+
pub(crate) const CROSS_ENTROPY_LOSS: &str = "cross_entropy";
61+
pub(crate) const DIFF_LOSS: &str = "diff";

0 commit comments

Comments
 (0)