This file contains hidden or 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
| # Simulate centered Bernoulli(p) random walk survival in [-1, 1] | |
| # and plot the estimated survival probability. | |
| # | |
| # How it works | |
| # ------------ | |
| # For X_i ~ Bernoulli(p), define S_j = sum_{i=0}^j (X_i - p). | |
| # For a trial "survives" up to time n if, for every j in {0,...,n}, | |
| # we have -1 <= S_j <= 1. We estimate the survival probability by | |
| # Monte Carlo over many independent trials. | |
| # |
This file contains hidden or 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
| # Simulate centered Bernoulli(p) random walk survival in [-1, 1] | |
| # and plot the estimated survival probability. | |
| # | |
| # How it works | |
| # ------------ | |
| # For X_i ~ Bernoulli(p), define S_j = sum_{i=0}^j (X_i - p). | |
| # For a trial "survives" up to time n if, for every j in {0,...,n}, | |
| # we have -1 <= S_j <= 1. We estimate the survival probability by | |
| # Monte Carlo over many independent trials. | |
| # |
This file contains hidden or 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
| async def run_agent( | |
| task: VerilogTask, | |
| client: LLMClient, | |
| tools: list[Tool], | |
| system_prompt: str = DEFAULT_SYSTEM_PROMPT, | |
| *, | |
| max_turns: int = 20, | |
| console: Optional[Union[Console, LogConsole]] = None, | |
| ) -> Tuple[Optional[VerificationResult], Dict[str, Any]]: |
This file contains hidden or 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
| 1: def _generated_forward(i:int, k:int, _var_5305017088:torch.Tensor, _var_5305017136:torch.Tensor, _var_5305023376:torch.Tensor) -> tuple[torch.Tensor]: | |
| 2: sum_ = 0 # (i, k) | |
| 3: # Product of 2 tensors | |
| 4: var_x = _var_5305023376 # (i, j) | |
| 5: var_w = _var_5305017088 # (j, k) | |
| 6: # var_x: (i, j) | |
| 7: # var_w: (j, k) | |
| 8: prod_ = ctg.array_contract( | |
| 9: arrays=[var_x, var_w], | |
| 10: inputs=[('i', 'j'), ('j', 'k')], |
This file contains hidden or 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
| 1: def _generated_forward(i:int, k:int, _var_5305017088:torch.Tensor, _var_5305017136:torch.Tensor, _var_5305023376:torch.Tensor) -> tuple[torch.Tensor]: | |
| 2: sum_ = 0 # (i, k) | |
| 3: # Product of 2 tensors | |
| 4: var_x = _var_5305023376 # (i, j) | |
| 5: var_w = _var_5305017088 # (j, k) | |
| 6: # var_x: (i, j) | |
| 7: # var_w: (j, k) | |
| 8: prod_ = ctg.array_contract( | |
| 9: arrays=[var_x, var_w], | |
| 10: inputs=[('i', 'j'), ('j', 'k')], |
This file contains hidden or 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
| import numpy as np | |
| from sklearn.linear_model import LinearRegression | |
| # Generate some example data | |
| np.random.seed(42) | |
| n_samples = 100 | |
| # Create synthetic features (x1: thickness, x2: stiffness, x3: scent, x4: another property) | |
| X = np.random.rand(n_samples, 4) * 10 # Random values between 0 and 10 |
This file contains hidden or 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
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # Parameters | |
| d = 5 | |
| n = 5 | |
| maxP = 10 | |
| n_samples = 10000 | |
| def formula_p1(n, d): |
This file contains hidden or 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
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # Parameters | |
| d = 10 | |
| maxP = 10 | |
| n_samples = 100 | |
| # Identity matrix | |
| ii = np.eye(d) |
This file contains hidden or 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
| import asyncio | |
| import asyncssh | |
| import re | |
| from nicegui import ui | |
| # SSH connection details | |
| SSH_HOST = 'remote_host' | |
| SSH_PORT = 22 | |
| SSH_USERNAME = 'username' | |
| SSH_PASSWORD = 'password' |
This file contains hidden or 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
| from manim import * | |
| import numpy as np | |
| class DualRingHeatTransferAnimation(Scene): | |
| def construct(self): | |
| # Configuration | |
| num_blocks = 20 | |
| num_around = 39 | |
| block_size = 0.4 | |
| outer_radius = 3.3 |
NewerOlder