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 torch | |
| class MicroCluster: | |
| def __init__(self, x, label, max_radius=0.1): | |
| self.N = 1 | |
| self.LS = x.clone() | |
| self.SS = x.pow(2) | |
| self.label = label | |
| self.max_radius = max_radius |
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 torch | |
| import time | |
| import numpy as np | |
| from sklearn.datasets import make_blobs | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.metrics import accuracy_score | |
| from microcluster_module import MClassification | |
| def generate_data(n_samples=1000, n_features=2, centers=5): | |
| X, y = make_blobs(n_samples=n_samples, n_features=n_features, centers=centers, random_state=42) |
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 torch | |
| class MicroCluster: | |
| def __init__(self, x, label, max_radius=0.1): | |
| self.N = 1 | |
| self.LS = x.clone() | |
| self.SS = x.pow(2) | |
| self.label = label | |
| self.max_radius = max_radius |
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
| class FinalScoreAnnotator: | |
| """ | |
| 1) Adds annotations of the last values of the curves | |
| 2) Aligns the annotations of the plot to avoid overlaps using L-BFGS-B | |
| Usage: | |
| Has the same signature and functionality as the plt.plot or ax.plot | |
| """ | |
| def __init__(self, ax=None): |
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 PIL import Image | |
| import numpy as np | |
| import torch | |
| import torchvision.transforms.functional as F | |
| from torchvision import transforms as T | |
| from torchvision.transforms.functional import _interpolation_modes_from_int, InterpolationMode | |
| import math | |
| from torchvision.transforms.transforms import _setup_size, _log_api_usage_once | |
| from collections.abc import Sequence | |
| from typing import List, Optional, Tuple, Union |
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
| 432908 <empty> | |
| 432909 <empty> | |
| 432910 <empty> | |
| 432911 <empty> | |
| 432912 <empty> | |
| 432913 <empty> | |
| 432914 <empty> | |
| 432915 <empty> | |
| 432916 <empty> | |
| 432917 <empty> |
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
| #!/bin/bash | |
| directory=$1 # Replace with your designated directory | |
| # Function to measure write time | |
| measure_write_time() { | |
| local file="$1" | |
| local start_time=$(date +%s%N) | |
| dd if=/dev/zero of="$file" bs=1M count=1 status=none | |
| local end_time=$(date +%s%N) |
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
| bottom_up_features, expt_flops, real_flops, gate_tensor = self.backbone(x, step_rate) | |
| File "/data/engs-tvg-depth/csbotos/miniconda3/envs/dyndet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl | |
| return forward_call(*input, **kwargs) | |
| File "/home/csbotos/github/fbscript/DynamicRouting/./dl_lib/modeling/dynamic_arch/dynamic_backbone.py", line 300, in forward | |
| self.all_cell_list[layer_index][_cell_index]( | |
| File "/data/engs-tvg-depth/csbotos/miniconda3/envs/dyndet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl | |
| return forward_call(*input, **kwargs) | |
| File "/home/csbotos/github/fbscript/DynamicRouting/./dl_lib/modeling/dynamic_arch/dynamic_cell.py", line 273, in forward | |
| result_list[2].append(h_l_down * gate_weights_beta_down) | |
| (function _print_stack) |
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 cv2 | |
| import time | |
| cap = cv2.VideoCapture(0) | |
| FRAME_DELAY = 120 | |
| cv2.namedWindow('frame', cv2.WINDOW_FREERATIO) | |
| # cv2.setWindowProperty('frame', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN) | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder