Skip to content

Commit 51dadb7

Browse files
committed
Run formatter
1 parent 8152241 commit 51dadb7

4 files changed

Lines changed: 19 additions & 46 deletions

File tree

src/Utilities.jl

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,7 @@ function initialize_and_encode_with_schedule!(
239239
observation::Union{Nothing, StructureVector} = nothing,
240240
prior_samples_in::Union{Nothing, StructureVector} = nothing,
241241
prior_samples_out::Union{Nothing, StructureVector} = nothing,
242-
) where {
243-
VV <: AbstractVector,
244-
PDC <: PairedDataContainer,
245-
}
242+
) where {VV <: AbstractVector, PDC <: PairedDataContainer}
246243
processed_io_pairs = deepcopy(io_pairs)
247244

248245
input_structure_mats = deepcopy(input_structure_mats)
@@ -271,24 +268,14 @@ function initialize_and_encode_with_schedule!(
271268
)
272269

273270
if apply_to == "in"
274-
input_structure_mats = Dict(
275-
name => encode_structure_matrix(processor, mat)
276-
for (name, mat) in input_structure_mats
277-
)
278-
input_structure_vecs = Dict(
279-
name => encode_data(processor, vec)
280-
for (name, vec) in input_structure_vecs
281-
)
271+
input_structure_mats =
272+
Dict(name => encode_structure_matrix(processor, mat) for (name, mat) in input_structure_mats)
273+
input_structure_vecs = Dict(name => encode_data(processor, vec) for (name, vec) in input_structure_vecs)
282274
processed_io_pairs = PairedDataContainer(processed, get_outputs(processed_io_pairs))
283275
elseif apply_to == "out"
284-
output_structure_mats = Dict(
285-
name => encode_structure_matrix(processor, mat)
286-
for (name, mat) in output_structure_mats
287-
)
288-
output_structure_vecs = Dict(
289-
name => encode_data(processor, vec)
290-
for (name, vec) in output_structure_vecs
291-
)
276+
output_structure_mats =
277+
Dict(name => encode_structure_matrix(processor, mat) for (name, mat) in output_structure_mats)
278+
output_structure_vecs = Dict(name => encode_data(processor, vec) for (name, vec) in output_structure_vecs)
292279
processed_io_pairs = PairedDataContainer(get_inputs(processed_io_pairs), processed)
293280
end
294281
end

src/Utilities/canonical_correlation.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,7 @@ $(TYPEDSIGNATURES)
205205
206206
Apply the `CanonicalCorrelation` encoder to a provided structure matrix
207207
"""
208-
function encode_structure_matrix(
209-
cc::CanonicalCorrelation,
210-
structure_matrix::SM,
211-
) where {SM <: StructureMatrix}
208+
function encode_structure_matrix(cc::CanonicalCorrelation, structure_matrix::SM) where {SM <: StructureMatrix}
212209
encoder_mat = get_encoder_mat(cc)[1]
213210
return encoder_mat * structure_matrix * encoder_mat'
214211
end
@@ -218,10 +215,7 @@ $(TYPEDSIGNATURES)
218215
219216
Apply the `CanonicalCorrelation` decoder to a provided structure matrix
220217
"""
221-
function decode_structure_matrix(
222-
cc::CanonicalCorrelation,
223-
enc_structure_matrix::SM,
224-
) where {SM <: StructureMatrix}
218+
function decode_structure_matrix(cc::CanonicalCorrelation, enc_structure_matrix::SM) where {SM <: StructureMatrix}
225219
decoder_mat = get_decoder_mat(cc)[1]
226220
return decoder_mat * enc_structure_matrix * decoder_mat'
227221
end

src/Utilities/decorrelator.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ $(TYPEDSIGNATURES)
211211
212212
Apply the `Decorrelator` encoder to a provided structure matrix
213213
"""
214-
function encode_structure_matrix(
215-
dd::Decorrelator,
216-
structure_matrix::SM,
217-
) where {SM <: StructureMatrix}
214+
function encode_structure_matrix(dd::Decorrelator, structure_matrix::SM) where {SM <: StructureMatrix}
218215
encoder_mat = get_encoder_mat(dd)[1]
219216
return encoder_mat * structure_matrix * encoder_mat'
220217
end
@@ -224,10 +221,7 @@ $(TYPEDSIGNATURES)
224221
225222
Apply the `Decorrelator` decoder to a provided structure matrix
226223
"""
227-
function decode_structure_matrix(
228-
dd::Decorrelator,
229-
enc_structure_matrix::SM,
230-
) where {SM <: StructureMatrix}
224+
function decode_structure_matrix(dd::Decorrelator, enc_structure_matrix::SM) where {SM <: StructureMatrix}
231225
decoder_mat = get_decoder_mat(dd)[1]
232226
return decoder_mat * enc_structure_matrix * decoder_mat'
233227
end

src/Utilities/elementwise_scaler.jl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,20 @@ $(TYPEDSIGNATURES)
156156
157157
Computes and populates the `shift` and `scale` fields for the `ElementwiseScaler`
158158
"""
159-
initialize_processor!(es::ElementwiseScaler, data::MM, structure_matrices, structure_vectors) where {MM <: AbstractMatrix} =
160-
initialize_processor!(es, data)
159+
initialize_processor!(
160+
es::ElementwiseScaler,
161+
data::MM,
162+
structure_matrices,
163+
structure_vectors,
164+
) where {MM <: AbstractMatrix} = initialize_processor!(es, data)
161165

162166

163167
"""
164168
$(TYPEDSIGNATURES)
165169
166170
Apply the `ElementwiseScaler` encoder to a provided structure matrix
167171
"""
168-
function encode_structure_matrix(
169-
es::ElementwiseScaler,
170-
structure_matrix::SM,
171-
) where {SM <: StructureMatrix}
172+
function encode_structure_matrix(es::ElementwiseScaler, structure_matrix::SM) where {SM <: StructureMatrix}
172173
return Diagonal(1 ./ get_scale(es)) * structure_matrix * Diagonal(1 ./ get_scale(es))
173174
end
174175

@@ -177,9 +178,6 @@ $(TYPEDSIGNATURES)
177178
178179
Apply the `ElementwiseScaler` decoder to a provided structure matrix
179180
"""
180-
function decode_structure_matrix(
181-
es::ElementwiseScaler,
182-
enc_structure_matrix::SM,
183-
) where {SM <: StructureMatrix}
181+
function decode_structure_matrix(es::ElementwiseScaler, enc_structure_matrix::SM) where {SM <: StructureMatrix}
184182
return Diagonal(get_scale(es)) * enc_structure_matrix * Diagonal(get_scale(es))
185183
end

0 commit comments

Comments
 (0)