What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-27 11:30:13
tensorboardx
# demo.py import torch import torchvision.utils as vutils import numpy as np import torchvision.models as models from torchvision import datasets from tensorboardX import SummaryWriter resnet18 = models.resnet18(False) writer = SummaryWriter() sample_ra... Add solution -
Python 2022-03-25 00:40:03
reset shuffed array python
import random class Solution(object): def __init__(self, nums): self.original = [x for x in nums] self.temp = nums self.indices = [x for x in range(len(nums))] def re... Add solution -
Python 2022-03-20 00:25:04
random.choices without repetition
random.sample(range(1, 16), 3) Add solution -
Other 2022-03-16 23:45:06
Three-dimensional Points and Lines
ax = plt.axes(projection='3d') # Data for a three-dimensional line zline = np.linspace(0, 15, 1000) xline = np.sin(zline) yline = np.cos(zline) ax.plot3D(xline, yline, zline, 'gray') # Data for three-dimensional scattered points zdata = 15 * np.random.r... Add solution -
Python 2022-03-13 11:35:06
generate random string python
import random import string def random_string_generator(str_size, allowed_chars): return ''.join(random.choice(allowed_chars) for x in range(str_size)) chars = string.ascii_letters + string.punctuation size = 12 print(chars) print('Random String of... Add solution -
Python 2022-03-13 04:10:03
Circular heatmap python
from pylab import * import numpy as np from scipy.interpolate import griddata #create 5000 Random points distributed within the circle radius 100 max_r = 100 max_theta = 2.0 * np.pi number_points = 5000 points = np.random.rand(number_points,2)*[max_r,max... Add solution -
Python 2022-03-13 00:45:08
guess the word python
import random # Put words to guess inside the array words = [] word = random.choice(words) n = len(word) print("Guess the word") guesses = '' #number of turn is equal to the legnth of the word stored in 'n' turns = n while turns > 0... Add solution