1
- TODO: include notes about gpu usage
1
+ ``` @setup 1DconvEx
2
+ using Plots; gr()
3
+ Plots.reset_defaults()
4
+ ```
2
5
# ConvFFT type #
3
6
The core type of this package. As a simple example in 1D:
4
7
``` @example 1DconvEx
@@ -8,7 +11,7 @@ w[55:60,2] = randn(6)
8
11
ŵ = rfft(w, 1)
9
12
W = ConvFFT(ŵ,nothing,(128,1,2))
10
13
plot(W, title="Time domain Filters", dispReal=true,
11
- apply=identity, vis=1:2)
14
+ apply=identity, vis=1:2);
12
15
savefig("randFilters.svg")#hide
13
16
```
14
17
![ ] ( randFilters.svg )
@@ -20,7 +23,7 @@ this to a signal `x`, which is non-zero at only the two boundary locations:
20
23
x = zeros(128,1,2);
21
24
x[1,1,2] = 1; x[end,1,2] = -1; # positive on one side and negative on the other
22
25
r = W(x); size(r)
23
- plot(r[:,:,1,2],title="convolved with x") #hide
26
+ plot(r[:,:,1,2],title="convolved with x"); #hide
24
27
savefig("convolveWx.svg") #hide
25
28
```
26
29
![ ] ( convolveWx.svg )
@@ -35,7 +38,7 @@ address this, e.g. `Pad(6)`
35
38
``` @example 1DconvEx
36
39
W = ConvFFT(ŵ,nothing,(128,1,2),boundary= Pad(6))
37
40
r =W(x); size(r)
38
- plot(r[:,:,1,2],title="convolved with x") #hide
41
+ plot(r[:,:,1,2],title="convolved with x"); #hide
39
42
savefig("convolveWxPad.svg") #hide
40
43
```
41
44
![ ] ( convolveWxPad.svg )
@@ -51,7 +54,7 @@ filt = ConvFFT(ex2Dsize, 3, relu, trainable=true,bias=false)
51
54
plot(heatmap(filt,dispReal=true,vis=1,colorbar=false,title="Filter 1"),
52
55
heatmap(filt,dispReal=true,vis=2,colorbar=false,title="Filter 2"),
53
56
heatmap(filt,dispReal=true,vis=3,colorbar=false, title="Filter 3"),
54
- layout=(1,3))
57
+ layout=(1,3));
55
58
savefig("2Dfilts.svg") #hide
56
59
```
57
60
![ ] ( 2Dfilts.svg )
@@ -68,7 +71,7 @@ genEx(n) = [(cpu(randn(ex2Dsize)), true) for i=1:n];
68
71
Flux.train!(loss, params(filt), genEx(100), ADAM())
69
72
plot(heatmap(filt,vis=1), heatmap(filt,vis=2), heatmap(filt,vis=3),
70
73
heatmap(targetConv,vis=1), heatmap(targetConv,vis=2),
71
- heatmap(targetConv,vis=3))
74
+ heatmap(targetConv,vis=3));
72
75
savefig("fitting2Dfilts.svg") #hide
73
76
```
74
77
![ ] ( fitting2Dfilts.svg )
@@ -113,9 +116,9 @@ The arguments are
113
116
using a rfft, this is only the postive frequencies in the first dimension
114
117
(vertical in the 2D shearlet plots and horizontal in the 1D plot).
115
118
``` @example 1DconvEx
116
- plot(heatmap(W2,title="first shearlet"), heatmap(W2,vis=4,title="Fourth shearlet"))
119
+ plot(heatmap(W2,title="first shearlet"), heatmap(W2,vis=4,title="Fourth shearlet"));
117
120
savefig("demoVis.svg") #hide
118
- plot(W1,vis=:,title="All of the Morlet Wavelets")
121
+ plot(W1,vis=:,title="All of the Morlet Wavelets");
119
122
savefig("demoVis1D.svg") #hide
120
123
```
121
124
![ ] ( demoVis.svg )
0 commit comments