Spaces:
Running
Running
File size: 2,379 Bytes
30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba 90b3e79 30e7eba |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Calculation for Dataset Training</title>
<script src="https://gradio.s3.amazonaws.com/gradio/2.4.1/gradio.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 20px;
background-color: #f9f9f9;
border: 1px solid #ddd;
border-radius: 5px;
}
.output {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #fff;
}
</style>
</head>
<body>
<h1>Time Calculation for Dataset Training</h1>
<label for="dataset_size">Dataset Size (kB):</label>
<input type="number" id="dataset_size" value="67.4" step="0.1"><br><br>
<label for="epochs">Number of Epochs:</label>
<input type="number" id="epochs" value="1"><br><br>
<button id="calculate_btn">Calculate</button>
<div class="output">
<h3 id="result_text"></h3>
<div id="result_latex"></div>
</div>
<script>
// Function to calculate total time and update results
document.getElementById("calculate_btn").onclick = function() {
const datasetSize = parseFloat(document.getElementById("dataset_size").value);
const epochs = parseInt(document.getElementById("epochs").value);
// Calculate time
const timePerEpoch = datasetSize / 405;
const totalTime = timePerEpoch * epochs;
// Create LaTeX representation
const latexEquation = `\\[ T = \\frac{S}{405} \\times n \\]`;
const latexOutput = `Total Time: ${totalTime.toFixed(4)} minutes<br>LaTeX Equation: ${latexEquation}`;
// Update HTML elements
document.getElementById("result_text").innerText = `Total Time: ${totalTime.toFixed(4)} minutes`;
document.getElementById("result_latex").innerHTML = latexOutput;
// Render LaTeX
MathJax.typeset();
};
</script>
<!-- Include MathJax for LaTeX rendering -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML"></script>
</body>
</html>
|