File size: 5,785 Bytes
b012e8c 52e76be | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three.js Scene</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #1a1a1a;
color: #fff;
overflow: hidden;
}
#canvas {
display: block;
width: 100%;
height: 100vh;
}
.controls-info {
position: absolute;
top: 20px;
right: 20px;
background-color: rgba(0, 0, 0, 0.8);
padding: 15px;
border-radius: 10px;
border: 2px solid #00d4ff;
font-size: 12px;
max-width: 250px;
}
.controls-info h3 {
color: #00d4ff;
margin-bottom: 10px;
}
.control-item {
margin-bottom: 8px;
}
.control-item strong {
color: #00d4ff;
}
/* HUD Top Bar */
.hud-container {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 60px;
background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(20, 25, 50, 0.95) 100%);
border-bottom: 2px solid #00d4ff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30px;
box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
z-index: 1000;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.hud-left {
display: flex;
align-items: center;
gap: 20px;
}
.hud-title {
font-size: 16px;
font-weight: bold;
color: #00d4ff;
letter-spacing: 1px;
}
.epoch-button {
background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
border: none;
color: #0a0e27;
padding: 8px 20px;
font-size: 14px;
font-weight: bold;
border-radius: 5px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}
.epoch-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}
.epoch-button:active {
transform: translateY(0);
box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
}
.hud-right {
display: flex;
align-items: center;
gap: 10px;
}
.accuracy-label {
font-size: 14px;
color: #ffd93d;
font-weight: 600;
}
.accuracy-value {
font-size: 16px;
color: #4ecdc4;
font-weight: bold;
min-width: 60px;
text-align: right;
}
#canvas {
display: block;
width: 100%;
height: 100vh;
margin-top: 0;
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<!-- HUD Top Bar -->
<div class="hud-container">
<div class="hud-left">
<div class="hud-title">Neural Network Visualizer</div>
<button class="epoch-button" id="epochButton">Next Epoch</button>
<!-- epoch counter: -->
<div class="epoch-counter" id="epochCounter" style="color: #ffffff; font-weight: bold; margin-left: 15px;">Epoch: 0</div>
<!-- loading / minibatch counter: -->
<div class="minibatch-counter" id="minibatchCounter" style="color: #ffffff; font-weight: bold; margin-left: 15px;">Minibatch: 0</div>
<!-- reset camera view button-->
<button class="button" id="resetCameraButton" style="margin-left: 15px; background: linear-gradient(135deg, #ff6f61 0%, #d64541 100%);">Reset Camera</button>
<a href="https://github.com/richardhcli/neural_network_visualization" target="_blank" style="margin-left: 15px; color: #00d4ff; text-decoration: none; font-weight: bold;">GitHub Repo</a>
</div>
<div class="hud-right">
<span class="accuracy-label">Accuracy:</span>
<span class="accuracy-value" id="accuracyValue">--</span>
</div>
</div>
<div class="controls-info">
<h3>Controls</h3>
<div class="control-item">
<strong>Left Click + Drag:</strong> Rotate
</div>
<div class="control-item">
<strong>Right Click + Drag:</strong> Pan
</div>
<div class="control-item">
<strong>Scroll Wheel:</strong> Zoom
</div>
<div class="control-item">
<strong>Double Click:</strong> Auto Focus
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
<!-- Import TensorFlow.js -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script>
<script src="SphereManager.js"></script>
<script src="ConnectionManager.js"></script>
<script src="MNIST_dataset.js"></script>
<script src="preprocessing.js"></script>
<script src="CustomNeuralNetwork.js"></script>
<script src="NetworkToDisplay.js"></script>
<script src="SceneManager.js"></script>
<script src="main.js"></script>
</body>
</html>
|