encoding and decoding pictures pytorch2019 Community Moderator ElectionUnicodeEncodeError: 'ascii' codec can't encode character u'xa0' in position 20: ordinal not in range(128)Model summary in pytorchTaking subsets of a pytorch datasetPyTorch Softmax Dimensions errorHow to initialize weights in PyTorch?Implementing a custom dataset with PyTorchEncoder Decoder Architecture in Pytorchcoverting roi pooling in pytorch to nn layerTrying to understand Pytorch neural translation code for decoderLSTM Encoder and Decoder architecture for specific case in Pytorch

What is this tube in a jet engine's air intake?

What will happen if my luggage gets delayed?

Finding the minimum value of a function without using Calculus

Would those living in a "perfect society" not understand satire

Will expression retain the same definition if particle is changed?

Are all players supposed to be able to see each others' character sheets?

Strange opamp's output impedance in spice

What does the Digital Threat scope actually do?

Why restrict private health insurance?

Is there stress on two letters on the word стоят

How do we create new idioms and use them in a novel?

Translation of 答えを知っている人はいませんでした

Short scifi story where reproductive organs are converted to produce "materials", pregnant protagonist is "found fit" to be a mother

Do Cubics always have one real root?

Use Mercury as quenching liquid for swords?

If nine coins are tossed, what is the probability that the number of heads is even?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Is there a math expression equivalent to the conditional ternary operator?

Why is there an extra space when I type "ls" on the Desktop?

Can the Witch Sight warlock invocation see through the Mirror Image spell?

If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?

Having the player face themselves after the mid-game

Do black holes violate the conservation of mass?

Cycles on the torus



encoding and decoding pictures pytorch



2019 Community Moderator ElectionUnicodeEncodeError: 'ascii' codec can't encode character u'xa0' in position 20: ordinal not in range(128)Model summary in pytorchTaking subsets of a pytorch datasetPyTorch Softmax Dimensions errorHow to initialize weights in PyTorch?Implementing a custom dataset with PyTorchEncoder Decoder Architecture in Pytorchcoverting roi pooling in pytorch to nn layerTrying to understand Pytorch neural translation code for decoderLSTM Encoder and Decoder architecture for specific case in Pytorch










1















Task: Using the example of the "fetch_lfw_people" dataset to write and train an autocoder.
Write an iteration code by epoch. Write code to visualize the learning process and count the metrics for validation after each epoch.
Train auto encoder. Achieve low loss on validation.



My code:



from sklearn.datasets import fetch_lfw_people
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split


Data preparation:



lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) 
X = lfw_people['images']

X_train, X_test = train_test_split(X, test_size=0.1)

X_train = torch.tensor(X_train, dtype=torch.float32, requires_grad=True)
X_test = torch.tensor(X_test, dtype=torch.float32, requires_grad=False)
dataset_train = TensorDataset(X_train, torch.zeros(len(X_train)))
dataset_test = TensorDataset(X_test, torch.zeros(len(X_test)))

batch_size = 32

train_loader = DataLoader(dataset_train, batch_size=batch_size, shuffle=True)
test_loader = DataLoader(dataset_test, batch_size=batch_size, shuffle=False)


Сreate a network with encoding and decoding functions:



class Autoencoder(torch.nn.Module): 
def __init__(self):
super(Autoencoder, self).__init__()
self.encoder = torch.nn.Sequential(
torch.nn.Conv2d(in_channels=1, out_channels=32, kernel_size=3, stride=2),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=32, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3)
)

self.decoder = torch.nn.Sequential(
torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=3, stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=(3,4), stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=32, kernel_size=4, stride=2),

torch.nn.ConvTranspose2d(in_channels=32, out_channels=1, kernel_size=(4,3), stride=2)
)

def encode(self, X):
encoded_X = self.encoder(X)
batch_size = X.shape[0]
return encoded_X.reshape(batch_size, -1)

def decode(self, X):
pre_decoder = X.reshape(-1, 64, 2, 1)
return self.decoder(pre_decoder)


I check the work of the model before learning by one example:



model = Autoencoder()

sample = X_test[:1]
sample = sample[:, None]
result = model.decode(model.encode(sample)) # before train

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(result[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


The result is unsatisfactory. I start training:



model = Autoencoder()
loss = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

history_train = []
history_test = []

for i in range(5):
for x, y in train_loader:
x = x[:, None]

model.train()

decoded_x = model.decode(model.encode(x))
mse_loss = loss(torch.tensor(decoded_x, dtype=torch.float), x)

optimizer.zero_grad()
mse_loss.backward()
optimizer.step()

history_train.append(mse_loss.detach().numpy())

model.eval()
with torch.no_grad():
for x, y in train_loader:
x = x[:, None]

result_x = model.decode(model.encode(x))
loss_test = loss(torch.tensor(result_x, dtype=torch.float), x)

history_test.append(loss_test.detach().numpy())

plt.subplot(1, 2, 1)
plt.plot(history_train)
plt.title("Optimization process for train data")

plt.subplot(1, 2, 2)
plt.plot(history_test)
plt.title("Loss for test data")

plt.show


A huge loss on the training data and on the test.



Аfter training nothing has changed:



with torch.no_grad():
model.eval()
res1 = model.decode(model.encode(sample))

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(res1[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


Why such a big loss? Reducing the input to the interval [-1, 1] does not help. I did it like this: (value / 255) * 2 - 1
Why do not change the parameters of the model after training?
Why does not change the decoded sample?



Result: before train, after train, loss
https://i.stack.imgur.com/OhdrJ.jpg










share|improve this question









New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • What's the exact point of including a bunch of plot commands without showing their results?

    – desertnaut
    Mar 7 at 0:06











  • Thanks! Results added.

    – TGorlenko
    2 days ago















1















Task: Using the example of the "fetch_lfw_people" dataset to write and train an autocoder.
Write an iteration code by epoch. Write code to visualize the learning process and count the metrics for validation after each epoch.
Train auto encoder. Achieve low loss on validation.



My code:



from sklearn.datasets import fetch_lfw_people
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split


Data preparation:



lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) 
X = lfw_people['images']

X_train, X_test = train_test_split(X, test_size=0.1)

X_train = torch.tensor(X_train, dtype=torch.float32, requires_grad=True)
X_test = torch.tensor(X_test, dtype=torch.float32, requires_grad=False)
dataset_train = TensorDataset(X_train, torch.zeros(len(X_train)))
dataset_test = TensorDataset(X_test, torch.zeros(len(X_test)))

batch_size = 32

train_loader = DataLoader(dataset_train, batch_size=batch_size, shuffle=True)
test_loader = DataLoader(dataset_test, batch_size=batch_size, shuffle=False)


Сreate a network with encoding and decoding functions:



class Autoencoder(torch.nn.Module): 
def __init__(self):
super(Autoencoder, self).__init__()
self.encoder = torch.nn.Sequential(
torch.nn.Conv2d(in_channels=1, out_channels=32, kernel_size=3, stride=2),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=32, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3)
)

self.decoder = torch.nn.Sequential(
torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=3, stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=(3,4), stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=32, kernel_size=4, stride=2),

torch.nn.ConvTranspose2d(in_channels=32, out_channels=1, kernel_size=(4,3), stride=2)
)

def encode(self, X):
encoded_X = self.encoder(X)
batch_size = X.shape[0]
return encoded_X.reshape(batch_size, -1)

def decode(self, X):
pre_decoder = X.reshape(-1, 64, 2, 1)
return self.decoder(pre_decoder)


I check the work of the model before learning by one example:



model = Autoencoder()

sample = X_test[:1]
sample = sample[:, None]
result = model.decode(model.encode(sample)) # before train

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(result[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


The result is unsatisfactory. I start training:



model = Autoencoder()
loss = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

history_train = []
history_test = []

for i in range(5):
for x, y in train_loader:
x = x[:, None]

model.train()

decoded_x = model.decode(model.encode(x))
mse_loss = loss(torch.tensor(decoded_x, dtype=torch.float), x)

optimizer.zero_grad()
mse_loss.backward()
optimizer.step()

history_train.append(mse_loss.detach().numpy())

model.eval()
with torch.no_grad():
for x, y in train_loader:
x = x[:, None]

result_x = model.decode(model.encode(x))
loss_test = loss(torch.tensor(result_x, dtype=torch.float), x)

history_test.append(loss_test.detach().numpy())

plt.subplot(1, 2, 1)
plt.plot(history_train)
plt.title("Optimization process for train data")

plt.subplot(1, 2, 2)
plt.plot(history_test)
plt.title("Loss for test data")

plt.show


A huge loss on the training data and on the test.



Аfter training nothing has changed:



with torch.no_grad():
model.eval()
res1 = model.decode(model.encode(sample))

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(res1[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


Why such a big loss? Reducing the input to the interval [-1, 1] does not help. I did it like this: (value / 255) * 2 - 1
Why do not change the parameters of the model after training?
Why does not change the decoded sample?



Result: before train, after train, loss
https://i.stack.imgur.com/OhdrJ.jpg










share|improve this question









New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • What's the exact point of including a bunch of plot commands without showing their results?

    – desertnaut
    Mar 7 at 0:06











  • Thanks! Results added.

    – TGorlenko
    2 days ago













1












1








1








Task: Using the example of the "fetch_lfw_people" dataset to write and train an autocoder.
Write an iteration code by epoch. Write code to visualize the learning process and count the metrics for validation after each epoch.
Train auto encoder. Achieve low loss on validation.



My code:



from sklearn.datasets import fetch_lfw_people
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split


Data preparation:



lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) 
X = lfw_people['images']

X_train, X_test = train_test_split(X, test_size=0.1)

X_train = torch.tensor(X_train, dtype=torch.float32, requires_grad=True)
X_test = torch.tensor(X_test, dtype=torch.float32, requires_grad=False)
dataset_train = TensorDataset(X_train, torch.zeros(len(X_train)))
dataset_test = TensorDataset(X_test, torch.zeros(len(X_test)))

batch_size = 32

train_loader = DataLoader(dataset_train, batch_size=batch_size, shuffle=True)
test_loader = DataLoader(dataset_test, batch_size=batch_size, shuffle=False)


Сreate a network with encoding and decoding functions:



class Autoencoder(torch.nn.Module): 
def __init__(self):
super(Autoencoder, self).__init__()
self.encoder = torch.nn.Sequential(
torch.nn.Conv2d(in_channels=1, out_channels=32, kernel_size=3, stride=2),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=32, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3)
)

self.decoder = torch.nn.Sequential(
torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=3, stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=(3,4), stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=32, kernel_size=4, stride=2),

torch.nn.ConvTranspose2d(in_channels=32, out_channels=1, kernel_size=(4,3), stride=2)
)

def encode(self, X):
encoded_X = self.encoder(X)
batch_size = X.shape[0]
return encoded_X.reshape(batch_size, -1)

def decode(self, X):
pre_decoder = X.reshape(-1, 64, 2, 1)
return self.decoder(pre_decoder)


I check the work of the model before learning by one example:



model = Autoencoder()

sample = X_test[:1]
sample = sample[:, None]
result = model.decode(model.encode(sample)) # before train

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(result[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


The result is unsatisfactory. I start training:



model = Autoencoder()
loss = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

history_train = []
history_test = []

for i in range(5):
for x, y in train_loader:
x = x[:, None]

model.train()

decoded_x = model.decode(model.encode(x))
mse_loss = loss(torch.tensor(decoded_x, dtype=torch.float), x)

optimizer.zero_grad()
mse_loss.backward()
optimizer.step()

history_train.append(mse_loss.detach().numpy())

model.eval()
with torch.no_grad():
for x, y in train_loader:
x = x[:, None]

result_x = model.decode(model.encode(x))
loss_test = loss(torch.tensor(result_x, dtype=torch.float), x)

history_test.append(loss_test.detach().numpy())

plt.subplot(1, 2, 1)
plt.plot(history_train)
plt.title("Optimization process for train data")

plt.subplot(1, 2, 2)
plt.plot(history_test)
plt.title("Loss for test data")

plt.show


A huge loss on the training data and on the test.



Аfter training nothing has changed:



with torch.no_grad():
model.eval()
res1 = model.decode(model.encode(sample))

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(res1[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


Why such a big loss? Reducing the input to the interval [-1, 1] does not help. I did it like this: (value / 255) * 2 - 1
Why do not change the parameters of the model after training?
Why does not change the decoded sample?



Result: before train, after train, loss
https://i.stack.imgur.com/OhdrJ.jpg










share|improve this question









New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Task: Using the example of the "fetch_lfw_people" dataset to write and train an autocoder.
Write an iteration code by epoch. Write code to visualize the learning process and count the metrics for validation after each epoch.
Train auto encoder. Achieve low loss on validation.



My code:



from sklearn.datasets import fetch_lfw_people
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split


Data preparation:



lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) 
X = lfw_people['images']

X_train, X_test = train_test_split(X, test_size=0.1)

X_train = torch.tensor(X_train, dtype=torch.float32, requires_grad=True)
X_test = torch.tensor(X_test, dtype=torch.float32, requires_grad=False)
dataset_train = TensorDataset(X_train, torch.zeros(len(X_train)))
dataset_test = TensorDataset(X_test, torch.zeros(len(X_test)))

batch_size = 32

train_loader = DataLoader(dataset_train, batch_size=batch_size, shuffle=True)
test_loader = DataLoader(dataset_test, batch_size=batch_size, shuffle=False)


Сreate a network with encoding and decoding functions:



class Autoencoder(torch.nn.Module): 
def __init__(self):
super(Autoencoder, self).__init__()
self.encoder = torch.nn.Sequential(
torch.nn.Conv2d(in_channels=1, out_channels=32, kernel_size=3, stride=2),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=32, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3),
torch.nn.ReLU(),

torch.nn.Conv2d(in_channels=64, out_channels=64, stride=2, kernel_size=3)
)

self.decoder = torch.nn.Sequential(
torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=3, stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=64, kernel_size=(3,4), stride=2),

torch.nn.ConvTranspose2d(in_channels=64, out_channels=32, kernel_size=4, stride=2),

torch.nn.ConvTranspose2d(in_channels=32, out_channels=1, kernel_size=(4,3), stride=2)
)

def encode(self, X):
encoded_X = self.encoder(X)
batch_size = X.shape[0]
return encoded_X.reshape(batch_size, -1)

def decode(self, X):
pre_decoder = X.reshape(-1, 64, 2, 1)
return self.decoder(pre_decoder)


I check the work of the model before learning by one example:



model = Autoencoder()

sample = X_test[:1]
sample = sample[:, None]
result = model.decode(model.encode(sample)) # before train

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(result[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


The result is unsatisfactory. I start training:



model = Autoencoder()
loss = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

history_train = []
history_test = []

for i in range(5):
for x, y in train_loader:
x = x[:, None]

model.train()

decoded_x = model.decode(model.encode(x))
mse_loss = loss(torch.tensor(decoded_x, dtype=torch.float), x)

optimizer.zero_grad()
mse_loss.backward()
optimizer.step()

history_train.append(mse_loss.detach().numpy())

model.eval()
with torch.no_grad():
for x, y in train_loader:
x = x[:, None]

result_x = model.decode(model.encode(x))
loss_test = loss(torch.tensor(result_x, dtype=torch.float), x)

history_test.append(loss_test.detach().numpy())

plt.subplot(1, 2, 1)
plt.plot(history_train)
plt.title("Optimization process for train data")

plt.subplot(1, 2, 2)
plt.plot(history_test)
plt.title("Loss for test data")

plt.show


A huge loss on the training data and on the test.



Аfter training nothing has changed:



with torch.no_grad():
model.eval()
res1 = model.decode(model.encode(sample))

fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
ax1.imshow(sample[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
ax2.imshow(res1[0][0].detach().numpy(), cmap=plt.cm.Greys_r)
plt.show()


Why such a big loss? Reducing the input to the interval [-1, 1] does not help. I did it like this: (value / 255) * 2 - 1
Why do not change the parameters of the model after training?
Why does not change the decoded sample?



Result: before train, after train, loss
https://i.stack.imgur.com/OhdrJ.jpg







python machine-learning neural-network pytorch






share|improve this question









New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago







TGorlenko













New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Mar 6 at 23:12









TGorlenkoTGorlenko

62




62




New contributor




TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






TGorlenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • What's the exact point of including a bunch of plot commands without showing their results?

    – desertnaut
    Mar 7 at 0:06











  • Thanks! Results added.

    – TGorlenko
    2 days ago

















  • What's the exact point of including a bunch of plot commands without showing their results?

    – desertnaut
    Mar 7 at 0:06











  • Thanks! Results added.

    – TGorlenko
    2 days ago
















What's the exact point of including a bunch of plot commands without showing their results?

– desertnaut
Mar 7 at 0:06





What's the exact point of including a bunch of plot commands without showing their results?

– desertnaut
Mar 7 at 0:06













Thanks! Results added.

– TGorlenko
2 days ago





Thanks! Results added.

– TGorlenko
2 days ago












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






TGorlenko is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55033669%2fencoding-and-decoding-pictures-pytorch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








TGorlenko is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















TGorlenko is a new contributor. Be nice, and check out our Code of Conduct.












TGorlenko is a new contributor. Be nice, and check out our Code of Conduct.











TGorlenko is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55033669%2fencoding-and-decoding-pictures-pytorch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page