Skip to content

Commit

Permalink
Merge pull request #22 from JuliaReach/auto-juliaformatter-pr
Browse files Browse the repository at this point in the history
Automatic JuliaFormatter.jl run
  • Loading branch information
schillic authored Aug 19, 2023
2 parents 472c149 + 8bab541 commit 6a4693d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/FileFormats/MAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function read_MAT(filename::String; act_key::String,
act_vec = data[act_key]
n_layer_ops = length(bias_vec) # number of layer operations

T = DenseLayerOp{<:ActivationFunction,Matrix{eltype(weights_vec[1])},Vector{eltype(bias_vec[1])}}
T = DenseLayerOp{<:ActivationFunction,Matrix{eltype(weights_vec[1])},
Vector{eltype(bias_vec[1])}}
layers = Vector{T}(undef, n_layer_ops)

for i in 1:n_layer_ops
Expand Down
3 changes: 2 additions & 1 deletion src/FileFormats/NNet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function read_NNet(filename::String)

# read layers except for the output layer (with ReLU activation)
T = DenseLayerOp{<:ActivationFunction,Matrix{Float32},Vector{Float32}}
layers = T[_read_layer_NNet(io, dim, Architecture._relu) for dim in layer_sizes[2:(end - 1)]]
layers = T[_read_layer_NNet(io, dim, Architecture._relu)
for dim in layer_sizes[2:(end - 1)]]

# read output layer (with identity activation)
return push!(layers, _read_layer_NNet(io, last(layer_sizes), Architecture._id))
Expand Down
4 changes: 2 additions & 2 deletions src/FileFormats/Sherlock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function _read_Sherlock_POLAR(filename::String, read_activations, layer_type, re
layers[i] = DenseLayerOp(W, b, activations(i))
end

read_end(io)
return read_end(io)
end

return FeedforwardNetwork(layers)
Expand Down Expand Up @@ -137,7 +137,7 @@ function _write_Sherlock_POLAR(N::FeedforwardNetwork, filename::String,
end

# write end pattern
write_end(io)
return write_end(io)
end
return nothing
end
Expand Down
3 changes: 2 additions & 1 deletion src/FileFormats/YAML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function read_YAML(filename::String)
act_vec = data["activations"]
n_layer_ops = length(bias_vec) # number of layer operations

T = DenseLayerOp{<:ActivationFunction,Matrix{eltype(eltype(weights_vec[1]))},Vector{eltype(bias_vec[1])}}
T = DenseLayerOp{<:ActivationFunction,Matrix{eltype(eltype(weights_vec[1]))},
Vector{eltype(bias_vec[1])}}
layers = Vector{T}(undef, n_layer_ops)

for i in 1:n_layer_ops
Expand Down

0 comments on commit 6a4693d

Please sign in to comment.