This file contains 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
{ | |
"_format": "hh-sol-artifact-1", | |
"contractName": "Greeter", | |
"sourceName": "contracts/Greeter.sol", | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "string", | |
"name": "_greeting", |
This file contains 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
constructor() ERC721("Pepsi Mic Drop", "PEPSIMICDROP") { | |
reserveMicDropsId = 1; // item 1-50 | |
micDropsId = 51; // item 51-1893 | |
} |
This file contains 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
/*** | |
By accepting the limited-edition Pepsi Mic Drop content ("Content") in the form of this non-fungible token ("NFT"), recipient acknowledges and agrees to the following terms and conditions (these "Terms"): | |
The Content is the property of or licensed to PepsiCo, Inc. ("Owner") and all right, title, and interest (including all copyright, trademark, name, likeness, art, design, drawings and/or other intellectual property) included in and/or associated with the Content are owned by Owner or its licensors. Receipt of the Content or this NFT does not give or grant recipient any right, license, or ownership in or to the Content other than the rights expressly set forth herein. Owner reserves all rights (including with respect to the copyright, trademark, name, likeness, art, design, drawings and/or other intellectual property) in and to the Content not expressly granted to recipient herein. Expressly conditioned on recipient's compliance with its obligations hereunder, recipient of this NFT is granted a limited, |
This file contains 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 matplotlib.pyplot as plt | |
from sklearn.datasets.samples_generator import make_blobs | |
from sklearn.cluster import KMeans | |
# Generate data | |
X, _ = make_blobs(n_samples=300, centers=5, | |
cluster_std=2, random_state=0) | |
# Fit K-means with different choice of K, | |
# and save the corresponding S |
This file contains 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 sklearn.cluster import KMeans | |
import numpy as np | |
# Generate data to be clustered | |
X = np.array([[1, 2], [1, 4], [1, 0], | |
[10, 2], [10, 4], [10, 0]]) | |
# Init K-menas model and clustering | |
kmeans = KMeans(n_clusters=2).fit(X) |
This file contains 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
# Create a TCL layer with kernel_size=2, stride=2, dilation=2 | |
transConv5 = nn.ConvTranspose2d(1, 1, 2, stride=2, dilation=2, bias=False) | |
# Set kernel weights to be 1 | |
transConv5.weight.data = torch.ones(1,1,2,2) | |
# Calculate | |
transConv5(input_data) | |
# Output: | |
# tensor([[[[ 1., 0., 3., 0., 2.], | |
# [ 0., 0., 0., 0., 0.], |
This file contains 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
# Create a TCL layer with stride=2, output_padding=1 | |
transConv4 = nn.ConvTranspose2d(1, 1, 3, stride=2, output_padding=1, bias=False) | |
# Set kernel weights to be 1 | |
transConv4.weight.data = torch.ones(1,1,3,3) | |
# Calculate | |
transConv4(input_data) | |
# Output: | |
# tensor([[[[ 1., 1., 3., 2., 2., 0.], | |
# [ 1., 1., 3., 2., 2., 0.], |
This file contains 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
# Create a TCL layer with stride=2, padding=1 | |
transConv3 = nn.ConvTranspose2d(1, 1, 3, stride=2, padding=1, bias=False) | |
# Set kernel weights to be 1 | |
transConv3.weight.data = torch.ones(1,1,3,3) | |
# Calculate | |
transConv3(input_data) | |
# Output: | |
# tensor([[[[ 1., 3., 2.], | |
# [ 4., 10., 6.], |
This file contains 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
# Create a TCL layer with stride=2 | |
transConv2 = nn.ConvTranspose2d(1, 1, 3, stride=2, bias=False) | |
# Set kernel weights to be 1 | |
transConv2.weight.data = torch.ones(1,1,3,3) | |
# Calculate | |
transConv2(input_data) | |
# Output: | |
# tensor([[[[ 1., 1., 3., 2., 2.], | |
# [ 1., 1., 3., 2., 2.], |
This file contains 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 | |
from torch import nn | |
# Create 2x2 input tensor | |
input_data = torch.tensor([[[[1.,2.],[3.,4.]]]]) | |
# Create a TCL layer with kernel_size=3 | |
transConv1 = nn.ConvTranspose2d(1, 1, 3, bias=False) | |
# Set kernel weights to be 1 | |
transConv1.weight.data = torch.ones(1,1,3,3) | |
# Calculate the output |
NewerOlder