code stringlengths 3 6.57k |
|---|
denorm(self, image) |
image.dim() |
image.dim() |
image.size(0) |
zip(image, self.MEAN, self.STD) |
t.mul_(s) |
add_(m) |
image.dim() |
image.size(1) |
zip((0,1,2) |
mul_(s) |
add_(m) |
__getitem__(self, index) |
Image.open(self.images[seq_from]) |
torch.LongTensor(self.cfg.DATASET.NUM_CLASSES) |
fill_(-1) |
torch.LongTensor(self.cfg.DATASET.NUM_CLASSES, h, w) |
zero_() |
set() |
range(seq_from, seq_to) |
Image.open(self.images[t]) |
convert('RGB') |
fns.append(os.path.basename(self.images[t].replace(".jpg", "") |
flags.append(self.flags[t]) |
os.path.isfile(self.masks[t]) |
Image.open(self.masks[t]) |
torch.from_numpy(np.array(mask, np.long, copy=False) |
np.unique(mask) |
known_ids.add(oid) |
long() |
Image.new('L', image.size) |
self.tf(image) |
images.append(image) |
torch.stack(images, 0) |
torch.LongTensor(flags) |
len(known_ids) |
cross_corr_plot(ts: "TSDataset", n_segments: int = 10, maxlags: int = 21, segments: Optional[Sequence] = None) |
list(ts.segments) |
np.random.choice(segments, size=min(len(segments) |
list(combinations(segments, r=2) |
len(segment_pairs) |
ValueError("There are no pairs to plot! Try set n_segments > 1.") |
min(2, len(segment_pairs) |
math.ceil(len(segment_pairs) |
plt.subplots(rows_num, columns_num, figsize=(20, 5 * rows_num) |
ax.ravel() |
fig.suptitle("Cross-correlation", fontsize=16) |
enumerate(segment_pairs) |
utils.create_mpl_ax(ax[i]) |
target_1.astype(float) |
target_2.astype(float) |
axx.xcorr(x=target_1, y=target_2, maxlags=maxlags) |
plot(lags, level, "o", markersize=5) |
set_title(f"{segment_1} vs {segment_2}") |
xaxis.set_major_locator(MaxNLocator(integer=True) |
plt.show() |
sample_acf_plot(ts: "TSDataset", n_segments: int = 10, lags: int = 21, segments: Sequence = None) |
sorted(ts.segments) |
min(n_segments, len(segments) |
min(2, k) |
math.ceil(k / columns_num) |
plt.subplots(rows_num, columns_num, figsize=(20, 5 * rows_num) |
ax.ravel() |
fig.suptitle("Partial Autocorrelation", fontsize=16) |
enumerate(sorted(np.random.choice(segments, size=k, replace=False) |
plot_acf(x=df_slice["target"].values, ax=ax[i], lags=lags) |
set_title(name) |
plt.show() |
sample_pacf_plot(ts: "TSDataset", n_segments: int = 10, lags: int = 21, segments: Sequence = None) |
sorted(ts.segments) |
min(n_segments, len(segments) |
min(2, k) |
math.ceil(k / columns_num) |
plt.subplots(rows_num, columns_num, figsize=(20, 5 * rows_num) |
ax.ravel() |
fig.suptitle("Partial Autocorrelation", fontsize=16) |
enumerate(sorted(np.random.choice(segments, size=k, replace=False) |
plot_pacf(x=df_slice["target"].values, ax=ax[i], lags=lags) |
set_title(name) |
plt.show() |
ts.to_pandas(flatten=True) |
df_pd.segment.unique() |
np.random.choice(segments, size=min(len(segments) |
df_pd.segment.isin(segments) |
df_full.groupby("segment") |
target.shift(shift) |
transform(lambda s: s.rolling(window) |
mean() |
df_full.groupby("segment") |
target.shift(shift) |
transform(lambda s: s.rolling(window) |
std() |
df_full.dropna() |
df_full.groupby([df_full.timestamp.dt.to_period(freq) |
min(2, len(grouped_data) |
min(n_rows, math.ceil(len(grouped_data) |
set(list(grouped_data.groups.keys() |
plt.subplots(rows_num, columns_num, figsize=(20, 7.5 * rows_num) |
fig.suptitle(f"Z statistic shift: {shift} window: {window}", fontsize=16) |
ax.ravel() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.