-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #579 from LuxDL/ap/agg_tutorials
Add a gallery component
- Loading branch information
Showing
24 changed files
with
298 additions
and
131 deletions.
There are no files selected for viewing
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- https://codepen.io/heyDante/pen/bxEYOw --> | ||
|
||
<script setup lang="ts"> | ||
import GalleryImage, { type Props } from './GalleryImage.vue'; | ||
|
||
defineProps<{ | ||
images: Props[]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div class="gallery-image"> | ||
<GalleryImage v-for="image in images" v-bind="image" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.heading { | ||
text-align: center; | ||
font-size: 2em; | ||
letter-spacing: 1px; | ||
padding: 40px; | ||
color: white; | ||
} | ||
|
||
.gallery-image { | ||
padding: 20px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
} | ||
|
||
.gallery-image :deep(img) { | ||
height: 350px; | ||
width: 250px; | ||
transform: scale(1); | ||
transition: transform 0.4s ease; | ||
} | ||
</style> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<script setup lang="ts"> | ||
import { withBase } from 'vitepress' | ||
export interface Props { | ||
href: string; | ||
src: string; | ||
caption: string; | ||
desc: string; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<template> | ||
<div class="img-box"> | ||
<a :href="href"> | ||
<img :src="withBase(src)" height="150px" alt=""> | ||
<div class="transparent-box1"> | ||
<div class="caption"> | ||
<h2>{{ caption }}</h2> | ||
</div> | ||
</div> | ||
<div class="transparent-box2"> | ||
<div class="subcaption"> | ||
<p class="opacity-low">{{ desc }}</p> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.img-box { | ||
box-sizing: content-box; | ||
border-radius: 14px; | ||
margin: 20px; | ||
height: 350px; | ||
width: 250px; | ||
overflow: hidden; | ||
display: inline-block; | ||
color: white; | ||
position: relative; | ||
background-color: transparent; | ||
border: 2px solid var(--vp-c-bg-alt); | ||
} | ||
.img-box h2 { | ||
border-top: 0; | ||
} | ||
.img-box img { | ||
height: 100%; | ||
width: 100%; | ||
object-fit: cover; | ||
opacity: 0.3; | ||
transition: transform 0.3s ease, opacity 0.3s ease; | ||
} | ||
.caption { | ||
position: absolute; | ||
bottom: 30px; | ||
color: var(--vp-c-text-1); | ||
left: 10px; | ||
opacity: 1; | ||
transition: transform 0.3s ease, opacity 0.3s ease; | ||
} | ||
.subcaption { | ||
position: absolute; | ||
bottom: 5px; | ||
color: var(--vp-c-text-1); | ||
left: 10px; | ||
opacity: 0; | ||
transition: transform 0.3s ease, opacity 0.3s ease; | ||
} | ||
.transparent-box1 { | ||
height: 250px; | ||
width: 250px; | ||
background-color: transparent; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
transition: background-color 0.3s ease; | ||
} | ||
.transparent-box2 { | ||
height: 100px; | ||
width: 250px; | ||
background-color: transparent; | ||
position: absolute; | ||
top: 250px; | ||
left: 0; | ||
transition: background-color 0.3s ease; | ||
} | ||
.img-box:hover img { | ||
transform: scale(1.1); | ||
} | ||
.img-box:hover .transparent-box1 { | ||
background-color: var(--vp-c-bg-alt); | ||
} | ||
.img-box:hover .transparent-box2 { | ||
background-color: var(--vp-c-bg-alt); | ||
} | ||
.img-box:hover .caption { | ||
transform: translateY(-20px); | ||
opacity: 1; | ||
} | ||
.img-box:hover .subcaption { | ||
transform: translateY(-20px); | ||
opacity: 1; | ||
} | ||
.img-box:hover { | ||
border: 2px solid var(--vp-c-brand-light); | ||
cursor: pointer; | ||
} | ||
.caption>p:nth-child(2) { | ||
font-size: 0.8em; | ||
} | ||
.subcaption>p:nth-child(2) { | ||
font-size: 0.8em; | ||
} | ||
.opacity-low { | ||
opacity: 0.85; | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
bf9c763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark Results
Dense(2 => 2)/cpu/reverse/ReverseDiff (compiled)/(2, 128)
3625.625
ns3674.375
ns0.99
Dense(2 => 2)/cpu/reverse/Zygote/(2, 128)
8329.6
ns8120
ns1.03
Dense(2 => 2)/cpu/reverse/Tracker/(2, 128)
20008
ns14758
ns1.36
Dense(2 => 2)/cpu/reverse/ReverseDiff/(2, 128)
9760.2
ns9956.6
ns0.98
Dense(2 => 2)/cpu/reverse/Flux/(2, 128)
8968.8
ns9099.25
ns0.99
Dense(2 => 2)/cpu/reverse/SimpleChains/(2, 128)
4533.5
ns4552.25
ns1.00
Dense(2 => 2)/cpu/forward/NamedTuple/(2, 128)
1983.8
ns1946.6
ns1.02
Dense(2 => 2)/cpu/forward/ComponentArray/(2, 128)
1638.599290780142
ns1652.8661971830986
ns0.99
Dense(2 => 2)/cpu/forward/Flux/(2, 128)
1802.7111111111112
ns1809.8431372549019
ns1.00
Dense(2 => 2)/cpu/forward/SimpleChains/(2, 128)
179.69327731092437
ns179.78851540616247
ns1.00
Dense(20 => 20)/cpu/reverse/ReverseDiff (compiled)/(20, 128)
17463
ns17672
ns0.99
Dense(20 => 20)/cpu/reverse/Zygote/(20, 128)
18505
ns18465
ns1.00
Dense(20 => 20)/cpu/reverse/Tracker/(20, 128)
35877
ns35817
ns1.00
Dense(20 => 20)/cpu/reverse/ReverseDiff/(20, 128)
28904
ns28573
ns1.01
Dense(20 => 20)/cpu/reverse/Flux/(20, 128)
19788
ns19737
ns1.00
Dense(20 => 20)/cpu/reverse/SimpleChains/(20, 128)
17162
ns17162
ns1
Dense(20 => 20)/cpu/forward/NamedTuple/(20, 128)
4897.714285714285
ns4893.428571428572
ns1.00
Dense(20 => 20)/cpu/forward/ComponentArray/(20, 128)
4976.571428571428
ns4952.142857142857
ns1.00
Dense(20 => 20)/cpu/forward/Flux/(20, 128)
4939.285714285715
ns4907.714285714285
ns1.01
Dense(20 => 20)/cpu/forward/SimpleChains/(20, 128)
1662.1
ns1652.1
ns1.01
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 3, 128)
40744614.5
ns39556217
ns1.03
Conv((3, 3), 3 => 3)/cpu/reverse/Zygote/(64, 64, 3, 128)
79080421
ns65510599
ns1.21
Conv((3, 3), 3 => 3)/cpu/reverse/Tracker/(64, 64, 3, 128)
82653235
ns76064407
ns1.09
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff/(64, 64, 3, 128)
86200963
ns88871403.5
ns0.97
Conv((3, 3), 3 => 3)/cpu/reverse/Flux/(64, 64, 3, 128)
78905084.5
ns72809658
ns1.08
Conv((3, 3), 3 => 3)/cpu/reverse/SimpleChains/(64, 64, 3, 128)
12176069
ns12100554
ns1.01
Conv((3, 3), 3 => 3)/cpu/forward/NamedTuple/(64, 64, 3, 128)
11531072.5
ns9991109.5
ns1.15
Conv((3, 3), 3 => 3)/cpu/forward/ComponentArray/(64, 64, 3, 128)
11556258
ns10432405.5
ns1.11
Conv((3, 3), 3 => 3)/cpu/forward/Flux/(64, 64, 3, 128)
11564044
ns10016491
ns1.15
Conv((3, 3), 3 => 3)/cpu/forward/SimpleChains/(64, 64, 3, 128)
6462543
ns6390966
ns1.01
vgg16/cpu/reverse/Zygote/(32, 32, 3, 1)
109222130
ns98848326.5
ns1.10
vgg16/cpu/reverse/Zygote/(32, 32, 3, 16)
716498141
ns764292345.5
ns0.94
vgg16/cpu/reverse/Zygote/(32, 32, 3, 64)
2774434429
ns2515730554
ns1.10
vgg16/cpu/reverse/Tracker/(32, 32, 3, 1)
165722314.5
ns156025821
ns1.06
vgg16/cpu/reverse/Tracker/(32, 32, 3, 16)
1141146395
ns1024851862.5
ns1.11
vgg16/cpu/reverse/Tracker/(32, 32, 3, 64)
3638853485
ns3539702577
ns1.03
vgg16/cpu/reverse/Flux/(32, 32, 3, 1)
85633954.5
ns82469855
ns1.04
vgg16/cpu/reverse/Flux/(32, 32, 3, 16)
679669495.5
ns710005717.5
ns0.96
vgg16/cpu/reverse/Flux/(32, 32, 3, 64)
2869660483
ns2858023873
ns1.00
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 1)
25584446.5
ns25939820
ns0.99
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 16)
235037986
ns207642246.5
ns1.13
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 64)
891040822
ns842419380
ns1.06
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 1)
26661185
ns26103135
ns1.02
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 16)
237554693
ns233006946
ns1.02
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 64)
883259646
ns809485246.5
ns1.09
vgg16/cpu/forward/Flux/(32, 32, 3, 1)
23363541.5
ns30921860
ns0.76
vgg16/cpu/forward/Flux/(32, 32, 3, 16)
202016108
ns203061153
ns0.99
vgg16/cpu/forward/Flux/(32, 32, 3, 64)
749216070.5
ns882871730
ns0.85
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 64, 128)
1041528133
ns1075834254
ns0.97
Conv((3, 3), 64 => 64)/cpu/reverse/Zygote/(64, 64, 64, 128)
1953104606
ns1918214947.5
ns1.02
Conv((3, 3), 64 => 64)/cpu/reverse/Tracker/(64, 64, 64, 128)
2174288920.5
ns2215726277.5
ns0.98
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff/(64, 64, 64, 128)
2535798497
ns2358848457
ns1.08
Conv((3, 3), 64 => 64)/cpu/reverse/Flux/(64, 64, 64, 128)
1905801894
ns1926331223
ns0.99
Conv((3, 3), 64 => 64)/cpu/forward/NamedTuple/(64, 64, 64, 128)
467810649
ns365007811.5
ns1.28
Conv((3, 3), 64 => 64)/cpu/forward/ComponentArray/(64, 64, 64, 128)
401897224
ns435227716
ns0.92
Conv((3, 3), 64 => 64)/cpu/forward/Flux/(64, 64, 64, 128)
363511714
ns376326451.5
ns0.97
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 1, 128)
11993043.5
ns12040318
ns1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Zygote/(64, 64, 1, 128)
18118667
ns18052787
ns1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Tracker/(64, 64, 1, 128)
19266770.5
ns19200702
ns1.00
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff/(64, 64, 1, 128)
23946772
ns23895482
ns1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Flux/(64, 64, 1, 128)
18001429
ns17998985
ns1.00
Conv((3, 3), 1 => 1)/cpu/reverse/SimpleChains/(64, 64, 1, 128)
1173906
ns1162245
ns1.01
Conv((3, 3), 1 => 1)/cpu/forward/NamedTuple/(64, 64, 1, 128)
2083284
ns2074705
ns1.00
Conv((3, 3), 1 => 1)/cpu/forward/ComponentArray/(64, 64, 1, 128)
2109134
ns2088735.5
ns1.01
Conv((3, 3), 1 => 1)/cpu/forward/Flux/(64, 64, 1, 128)
2087096
ns2079959
ns1.00
Conv((3, 3), 1 => 1)/cpu/forward/SimpleChains/(64, 64, 1, 128)
216375
ns203118
ns1.07
Dense(200 => 200)/cpu/reverse/ReverseDiff (compiled)/(200, 128)
299811
ns303455.5
ns0.99
Dense(200 => 200)/cpu/reverse/Zygote/(200, 128)
274022
ns274336
ns1.00
Dense(200 => 200)/cpu/reverse/Tracker/(200, 128)
366305
ns363268
ns1.01
Dense(200 => 200)/cpu/reverse/ReverseDiff/(200, 128)
412983
ns413520
ns1.00
Dense(200 => 200)/cpu/reverse/Flux/(200, 128)
273692
ns275854
ns0.99
Dense(200 => 200)/cpu/reverse/SimpleChains/(200, 128)
407292
ns406938
ns1.00
Dense(200 => 200)/cpu/forward/NamedTuple/(200, 128)
88606
ns89587
ns0.99
Dense(200 => 200)/cpu/forward/ComponentArray/(200, 128)
89167
ns89717
ns0.99
Dense(200 => 200)/cpu/forward/Flux/(200, 128)
86702
ns86892
ns1.00
Dense(200 => 200)/cpu/forward/SimpleChains/(200, 128)
104917
ns104365
ns1.01
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 16, 128)
204802127.5
ns200351480
ns1.02
Conv((3, 3), 16 => 16)/cpu/reverse/Zygote/(64, 64, 16, 128)
397826293
ns408642932
ns0.97
Conv((3, 3), 16 => 16)/cpu/reverse/Tracker/(64, 64, 16, 128)
407107142
ns440103689
ns0.93
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff/(64, 64, 16, 128)
468385350
ns456029536.5
ns1.03
Conv((3, 3), 16 => 16)/cpu/reverse/Flux/(64, 64, 16, 128)
379786116.5
ns408071183
ns0.93
Conv((3, 3), 16 => 16)/cpu/reverse/SimpleChains/(64, 64, 16, 128)
327214540
ns335433443
ns0.98
Conv((3, 3), 16 => 16)/cpu/forward/NamedTuple/(64, 64, 16, 128)
50982627.5
ns60980045
ns0.84
Conv((3, 3), 16 => 16)/cpu/forward/ComponentArray/(64, 64, 16, 128)
61754318.5
ns57470482
ns1.07
Conv((3, 3), 16 => 16)/cpu/forward/Flux/(64, 64, 16, 128)
51202786
ns57093732
ns0.90
Conv((3, 3), 16 => 16)/cpu/forward/SimpleChains/(64, 64, 16, 128)
28422322
ns28329442
ns1.00
Dense(2000 => 2000)/cpu/reverse/ReverseDiff (compiled)/(2000, 128)
19437690
ns19434661
ns1.00
Dense(2000 => 2000)/cpu/reverse/Zygote/(2000, 128)
19638543
ns19731528
ns1.00
Dense(2000 => 2000)/cpu/reverse/Tracker/(2000, 128)
23400447
ns23382597
ns1.00
Dense(2000 => 2000)/cpu/reverse/ReverseDiff/(2000, 128)
24207548
ns24160799
ns1.00
Dense(2000 => 2000)/cpu/reverse/Flux/(2000, 128)
19668914
ns19746006.5
ns1.00
Dense(2000 => 2000)/cpu/forward/NamedTuple/(2000, 128)
6590668
ns6626390.5
ns0.99
Dense(2000 => 2000)/cpu/forward/ComponentArray/(2000, 128)
6574953
ns6615541
ns0.99
Dense(2000 => 2000)/cpu/forward/Flux/(2000, 128)
6491001
ns6561480
ns0.99
This comment was automatically generated by workflow using github-action-benchmark.