This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ProximalOperators, Random | |
# Number of variables | |
n = 1000 | |
# Number of halfspaces | |
mi = 50 # Inequalities with C | |
me = 50 # Equalities with A | |
Random.seed!(1) | |
# One point in polytope | |
x0 = randn(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Test Plots | |
using ControlExamplePlots | |
using Plots | |
gr() | |
default(show=false) | |
funcs, refs, eps = getexamples() | |
# Make it easier to pass tests on different systems | |
# Set to a factor 2 of common errors | |
eps = [0.15, 0.015, 0.1, 0.01, 0.01, 0.02, 0.01, 0.15, 0.15, 0.01, 0.01] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Ipopt # Solver | |
using NLOptControl # Problem definition and discretization | |
using Plots # Custom plots | |
# =========== PROBLEM DEFINITION ============================== | |
# Constraints on states | |
XL = [-Inf,-Inf,-Inf,-Inf] | |
XU = [Inf,Inf,Inf,Inf] | |
# Constraints on control, we will add ux^2+uy^2 <= 1, so these won't be active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To add packages in the REPL: "]add BenchmarkTools" | |
using LinearAlgebra, BenchmarkTools | |
# Simple method and syntax, no types! | |
function quadratic(x,Q,y) | |
dot(x,Q*y) | |
end | |
Q = randn(5,5) | |
x = randn(5) | |
y = randn(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SimpleTreeInterface | |
export ChildrenFirst, ParentsFirst | |
export NodeOnly, NodeDepth, NodeIndex | |
abstract type AbstractReturnMode end | |
abstract type AbstractTreeIterator{T,RetMode<:AbstractReturnMode} end | |
struct NodeOnly <: AbstractReturnMode end | |
struct NodeDepth <: AbstractReturnMode end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Flux | |
const nn = gpu(Chain( | |
Conv((5, 5), 3=>6, relu), | |
MaxPool((2, 2)), | |
Conv((5, 5), 6=>16, relu), | |
MaxPool((2, 2)), | |
flatten, | |
Dense(256, 120, relu), | |
Dense(120, 84, relu), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: LoadError: TaskFailedException | |
nested task error: Out of GPU memory trying to allocate 897.217 MiB | |
Effective GPU memory usage: 52.47% (5.726 GiB/10.913 GiB) | |
Memory pool usage: 3.117 GiB (3.656 GiB reserved) | |
Stacktrace: | |
[1] macro expansion | |
@ ~/.julia/packages/CUDA/0IDh2/src/pool.jl:219 [inlined] | |
[2] macro expansion | |
@ ./timing.jl:299 [inlined] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: LoadError: TaskFailedException | |
Stacktrace: | |
[1] wait | |
@ ./task.jl:334 [inlined] | |
[2] fetch(t::Task) | |
@ Base ./task.jl:349 | |
[3] top-level scope | |
@ ~/knightvision/piece_recognition/KnightVisionServer/test/test_cuda.jl:39 | |
nested task error: CUDNNError: CUDNN_STATUS_INTERNAL_ERROR (code 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After execution gets stuck, sending `schedule(t, nothing, error=true)` to the task: | |
Stacktrace: | |
[1] try_yieldto(undo::typeof(Base.ensure_rescheduled)) | |
@ Base ./task.jl:777 | |
[2] wait() | |
@ Base ./task.jl:837 | |
[3] wait(c::Base.GenericCondition{ReentrantLock}) | |
@ Base ./condition.jl:123 | |
[4] wait(e::Base.Event) | |
@ Base ./lock.jl:366 |
OlderNewer