{"id":330055,"date":"2022-02-24T09:00:31","date_gmt":"2022-02-24T09:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330055"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330055","title":{"rendered":"<span>\u041e\u0431 \u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0430\u043c\u043e\u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u043f\u044b\u0442\u043e\u043a &#171;\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c&#187; \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u0438 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u0441\u0438\u0445\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u0430\u0448\u043d\u0430\u044f \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0438\u0437\u043d\u0430 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0451\u043c\u043a\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u044b, \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430: \u043f\u0440\u043e\u0441\u0442\u043e RNN, \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e &#171;\u0437\u0430\u0442\u0440\u0430\u0432\u043a\u0443&#187;, \u0441\u043a\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u0443\u044e \u0435\u0439, VAE \u0438 WGAN-GP5, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u0438\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u043d\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0442\u0438\u043b\u044e \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u044e \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0436\u0438\u0437\u043d\u044c, \u0441\u0443\u0434\u044f \u043f\u043e \u0438\u0445 &#171;\u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438&#187;. \u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 &#171;\u0434\u043e\u0442\u043e\u0448\u043d\u044b\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u0438\u043f\u0430 GPT-3, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u043b\u0435\u0433\u043a\u0430 \u043e\u0442\u0434\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0435\u0441\u0447\u0443\u0432\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u043e\u043d\u0438 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0451\u043c\u043a\u0438.<\/p>\n<p>\u041c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u0438\u0434\u0435\u043e, \u043f\u0440\u0438\u0447\u0451\u043c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u043f\u043e \u0445\u043e\u0434\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438. \u042f \u0432\u0437\u044f\u043b \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0443\u044e VAE, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u0441\u0432\u0451\u0440\u0442\u043a\u0438-\u0440\u0430\u0437\u0432\u0451\u0440\u0442\u043a\u0438 10 \u043d\u0430 10 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0441\u0442\u0440\u0430\u0439\u0434\u0430\u043c\u0438, \u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0432\u0451\u0440\u0442\u043a\u043e\u0439 \u0438 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u043a\u043e\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b 40 \u0441\u043b\u043e\u0451\u0432 \u0441\u0432\u0451\u0440\u0442\u043a\u0438 3 \u043d\u0430 3 \u0441 Gated Linear Unit, \u0442\u043e \u0435\u0441\u0442\u044c \u0441 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e, \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0443 (\u0432\u0441\u0451, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e), \u0430 \u0442\u0430\u043a\u0436\u0435 Group Normalization:<\/p>\n<pre><code class=\"python\">class GaussianEncoder(Module):     def __init__(self):         super(GaussianEncoder, self).__init__()         self.gn1 = GroupNorm(2, 128)         self.cnn1 = Conv2d(3, 128, kernel_size=(10, 10), stride=(10, 10))         self.cnn = torch.nn.ModuleList()         self.gn = torch.nn.ModuleList()         for i in range(0, 20):             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))             self.gn.append(GroupNorm(2, 128))         self.cnn_out = Conv2d(64, 8, kernel_size=(1, 1))         self.glu = GLU(dim=1)      def forward(self, x):         y = x         y = self.cnn1(y)         y = self.gn1(y)         y = self.glu(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_ = self.gn[i](y_)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g         y = self.cnn_out(y)         return y   class GaussianDecoder(Module):     def __init__(self):         super(GaussianDecoder, self).__init__()         self.cnn_in = Conv2d(8, 128, kernel_size=(1, 1))         self.gn_in = GroupNorm(2, 128)         self.gn = torch.nn.ModuleList()         self.cnn = torch.nn.ModuleList()         self.gn5 = torch.nn.GroupNorm(2, 6)         self.cnn5 = ConvTranspose2d(64, 6, kernel_size=(10, 10), stride=(10, 10))         for i in range(0, 20):             self.gn.append(GroupNorm(2, 128))             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))         self.glu = GLU(dim=1)      def forward(self, x):         y = x         y = self.cnn_in(y)         y = self.gn_in(y)         y = self.glu(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_ = self.gn[i](y_)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g         y = self.cnn5(y)         y = self.gn5(y)         y = self.glu(y)         return y   class GaussianAutoencoder(Module):     def __init__(self):         super(GaussianAutoencoder, self).__init__()         self.encoder = GaussianEncoder()         self.encoder_var = GaussianEncoder()         self.decoder = GaussianDecoder()         self.sigma = torch.nn.Parameter(torch.randn(1))         self.loss_fn = torch.nn.MSELoss(reduction='none')      def forward(self, x):         y = self.encoder(x)         y_var = self.encoder_var(x).sigmoid()         if self.training:             z = torch.distributions.Normal(y, y_var)             norm = Normal(0.0, 1.0)             y = z.rsample()             y = self.decoder(y)             t = Normal(y, (self.sigma.sigmoid() * 2.0 + 1e-6).sqrt())             y = t.rsample()             loss = self.loss_fn(y, x) \/ (2.0 * (self.sigma.sigmoid() * 2.0 + 1e-6))             loss = loss.mean(dim=0).sum() + div(z, norm).mean(dim=0).sum()             loss = loss + (self.sigma.sigmoid() * 2.0 + 1e-6).log() * 360.0 * 640.0 * 3.0 * 0.5             return y, loss         y = self.decoder(y)         return y     def encode(self, x):         y = self.encoder(x)         y_var = self.encoder_var(x).sigmoid()         z = Normal(y, y_var)         y = z.sample()         return y<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 sigma-VAE, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043e\u0431\u0443\u0447\u0430\u044e \u044d\u0442\u043e\u0442 \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0451\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/748\/11c\/0fe\/74811c0fe18fdf8191e3ed3fa00ea2bf.jpg\" width=\"4128\" height=\"2322\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/748\/11c\/0fe\/74811c0fe18fdf8191e3ed3fa00ea2bf.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2d2\/ff1\/e06\/2d2ff1e068c13b77979182089dfa1f05.jpg\" width=\"4128\" height=\"2322\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2d2\/ff1\/e06\/2d2ff1e068c13b77979182089dfa1f05.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a39\/6c7\/7a4\/a396c77a4c6fee87034b8b6cab29bd2c.jpg\" width=\"4128\" height=\"2322\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a39\/6c7\/7a4\/a396c77a4c6fee87034b8b6cab29bd2c.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0438 \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451: \u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440, \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u044e &#171;\u0440\u0435\u043a\u043e\u0434\u0435\u0440&#187;, \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434\u0430\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u0441\u043e\u0431\u043e\u0439 feature maps \u0441 8 \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e 36 \u043d\u0430 64 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440 360 \u043d\u0430 640):<\/p>\n<pre><code class=\"python\">def l2norm(x):     y = x * x     y = y.sum(dim=1, keepdim=True).sqrt()     y = x \/ y     return y  class Recoder(Module):     def __init__(self, ):         super(Recoder, self).__init__()         self.cnn_in = Conv2d(8, 64, kernel_size=(1, 1))         self.cnn = torch.nn.ModuleList()         for i in range(0, 20):             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))         self.cnn_out = Conv2d(64, 8, kernel_size=(1, 1))      def forward(self, x, return_h=False):         y = x         h = []         y = self.cnn_in(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g             y = l2norm(y)             h.append(y)         y = self.cnn_out(y)         if return_h:             return y, h         return y<\/code><\/pre>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a h \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c. \u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043a\u043e\u0434\u0435\u0440\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u0438, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0443\u044e \u043e\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438, \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u043c\u043e\u0439 \u0440\u0435\u043a\u043e\u0434\u0435\u0440 \u043a\u0430\u043a \u0431\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0442\u044f\u0433\u043e\u0439 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044e \u0438\u0434\u0435\u0430\u043b\u0443 \u0438 \u0442\u044f\u0433\u043e\u0439 \u043a \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044e:<\/p>\n<pre><code class=\"python\">  def corrloss(y, x):       zx = ((x - x.mean()) ** 2 + 1e-16).sum()       zy = ((y - y.mean()) ** 2 + 1e-16).sum()       z = 1.0 - ((x - x.mean()) * (y - y.mean()) \/ (zx * zy).sqrt()).sum()       r = (zx.log() - zy.log()) ** 2       r = r + (x.mean() - y.mean()) ** 2       return z, r t = float(i % 5300 + 1) \/ 5300.0 s1 = 1.0 - 1.0 \/ (2.0 ** (150.0 * (t - 0.1)) + 1.0) s2 = 1.0 - 1.0 \/ (2.0 ** (150.0 * (0.9 - t)) + 1.0) s_ = 1.0 \/ (1.0 + ((t - 0.9) * 100.0) ** 2.0) s_ = s_ + 1.0 \/ (1.0 + ((t - 0.93) * 100.0) ** 2.0) s_ = s_ + 1.0 \/ (1.0 + ((t - 0.96) * 100.0) ** 2.0) s = ((s1 + s2 - 1.0) * 0.16 + s_ \/ 0.8) y_, h = rec(x1, True) y_ = y_.tanh() * inp_c_max * 1.1 loss1, _ = corrloss(y_, x1) if i % 5300 &lt; 1060:   loss2, r = corrloss(y_, inp_code) else:   loss2, r = corrloss(y_, inp_code2) loss = loss1 * (loss1 - s).detach() loss = loss + loss2 * loss2.detach() * (1.0 - 0.8 * s) + 0.25 * r<\/code><\/pre>\n<p>inp_code \u0438 inp_code2 &#8212; \u044d\u0442\u043e \u043a\u043e\u0434\u044b \u043f\u0435\u0440\u0432\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, s1 \u0438 s2 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 &#171;\u043f\u043b\u0430\u0442\u043e&#187; \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043a\u0438 \u0441 \u043a\u043e\u043b\u043f\u0430\u0447\u043a\u043e\u043c, \u0430 s_ &#8212; \u0437\u0430 \u0435\u0433\u043e \u043a\u0443\u043b\u044c\u043c\u0438\u043d\u0430\u0446\u0438\u044e. \u0422\u0430\u043a\u0436\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u043a\u043e\u0434\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u0435\u0442\u043e\u0434 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"python\">x1 = x1 * 0.5 + 0.5 * y_<\/code><\/pre>\n<p>\u0410 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0438\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">with torch.no_grad(): triangular = (1.0 - (torch.arange(100).float().unsqueeze(0) - 50.0).abs() \/ 50.0) \/ 100.0 inp_code = autenc1.encode(inp) inp_code2 = autenc1.encode(inp2) inp_c_max = max([inp_code.abs().max(), inp_code2.abs().max()]) x1 = torch.randn(inp_code.size()) m = (torch.rand(20) * 36.0).long() n = (torch.rand(20) * 64.0).long() q = (torch.rand(20) * 16.0).long() p = (torch.rand(20) * 20.0).long()<\/code><\/pre>\n<p>triangular, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, &#8212; \u044d\u0442\u043e \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u043a\u0442\u0440\u0430 &#171;\u044d\u043d\u0446\u0435\u0444\u0430\u043b\u043e\u0433\u0440\u0430\u043c\u043c\u044b&#187; \u0440\u0435\u043a\u043e\u0434\u0435\u0440\u0430, \u0430 \u0441\u0430\u043c\u0430 \u0436\u0435 &#171;\u042d\u042d\u0413&#187; \u043d\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0432\u0441\u0451 \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"python\">  from PIL import Image    from matplotlib import pyplot   from scipy.fft import dct      h_var = [1.0] * 100   h_mu = [0.0] * 100  with torch.no_grad(): h1_ = [] for j in range(0, 20): h_ = (h[p[j]][:, q[j], m[j], n[j]] - h_mu[j]) \/ h_var[j] ** 0.5 h_mu[j] = h_mu[j] * 0.99 + h[p[j]][:, q[j], m[j], n[j]] * 0.01 h_var[j] = h_var[j] * 0.9 + 0.1 * (h[p[j]][:, q[j], m[j], n[j]] - h_mu[j]) ** 2 h1_.append(h_.unsqueeze(0))  h1_ = torch.cat(h1_, dim=0) h1.append(h1_) if (i + 1) % 1000 == 0: h1 = torch.cat(h1, dim=1).numpy() h1_ = torch.from_numpy(dct(h1, type=2, axis=1)) h1_ = 0.5 * (h1_ ** 2).log() h2 = [] for j in range(0, 900): h2.append((h1_[:, j:(j + 100)] * triangular).sum(dim=-1, keepdim=True)) h2 = torch.cat(h2, dim=1) for j in range(0, 20): fig = pyplot.figure(i \/\/ 1000 + 1) pyplot.plot(h2[j]) s_name = \".\/encephalograms_log_spectrae\/\" s_name = s_name + format(j + 1) s_name = s_name + \"\/pic_\" + format(p[j]) s_name = s_name + \"_\" + format(q[j]) s_name = s_name + \"_\" + format(m[j]) s_name = s_name + \"_\" + format(n[j]) s_name = s_name + \"_\" + format(i \/\/ 1000 + 1) s_name = s_name + \".jpg\" pyplot.savefig(s_name) pyplot.close(fig) fig = pyplot.figure(i \/\/ 1000 + 1, figsize=(20, 6), dpi=120) pyplot.plot(h1[j]) s_name = \".\/encephalograms\/\" s_name = s_name + format(j + 1) s_name = s_name + \"\/pic_\" + format(p[j]) s_name = s_name + \"_\" + format(q[j]) s_name = s_name + \"_\" + format(m[j]) s_name = s_name + \"_\" + format(n[j]) s_name = s_name + \"_\" + format(i \/\/ 1000 + 1) s_name = s_name + \".jpg\" pyplot.savefig(s_name) pyplot.close(fig) h1 = []<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043e\u0434, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043a\u0438 \u0441 \u043a\u043e\u043b\u043f\u0430\u0447\u043a\u043e\u043c, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62172f5f10d5580b3c67a13a\" data-style=\"\" id=\"62172f5f10d5580b3c67a13a\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u0437\u0434\u0435\u0441\u044c \u0441 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c\u0438 \u042d\u042d\u0413\u0448\u0435\u043a \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<p><a href=\"https:\/\/disk.yandex.ru\/d\/SOmVw9MYM9Cv8Q\" rel=\"noopener noreferrer nofollow\">https:\/\/disk.yandex.ru\/d\/SOmVw9MYM9Cv8Q<\/a><\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0442\u0440\u0435\u043d\u0438\u0440\u0443\u0435\u043c VAE \u0432 train.py, \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0432 test.py, \u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0451 \u0432 source_maker.py, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439.<\/p>\n<p>\u0412\u043e\u0442, \u043a\u0441\u0442\u0430\u0442\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u042d\u042d\u0413 \u0441\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/743\/8eb\/fd4\/7438ebfd4f0d68eb20e4916db18c8668.jpg\" width=\"2400\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/743\/8eb\/fd4\/7438ebfd4f0d68eb20e4916db18c8668.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/836\/435\/194\/836435194f8018f08f42413ea8b67358.jpg\" width=\"640\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/836\/435\/194\/836435194f8018f08f42413ea8b67358.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/653237\/\"> https:\/\/habr.com\/ru\/post\/653237\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u043f\u044b\u0442\u043e\u043a &#171;\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c&#187; \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u0438 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u0441\u0438\u0445\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u0430\u0448\u043d\u0430\u044f \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0438\u0437\u043d\u0430 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0451\u043c\u043a\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u044b, \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430: \u043f\u0440\u043e\u0441\u0442\u043e RNN, \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e &#171;\u0437\u0430\u0442\u0440\u0430\u0432\u043a\u0443&#187;, \u0441\u043a\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u0443\u044e \u0435\u0439, VAE \u0438 WGAN-GP5, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u0438\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u043d\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0442\u0438\u043b\u044e \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u044e \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0436\u0438\u0437\u043d\u044c, \u0441\u0443\u0434\u044f \u043f\u043e \u0438\u0445 &#171;\u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438&#187;. \u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 &#171;\u0434\u043e\u0442\u043e\u0448\u043d\u044b\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u0438\u043f\u0430 GPT-3, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u043b\u0435\u0433\u043a\u0430 \u043e\u0442\u0434\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0435\u0441\u0447\u0443\u0432\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u043e\u043d\u0438 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0451\u043c\u043a\u0438.<\/p>\n<p>\u041c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u0438\u0434\u0435\u043e, \u043f\u0440\u0438\u0447\u0451\u043c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u043f\u043e \u0445\u043e\u0434\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438. \u042f \u0432\u0437\u044f\u043b \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0443\u044e VAE, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u0441\u0432\u0451\u0440\u0442\u043a\u0438-\u0440\u0430\u0437\u0432\u0451\u0440\u0442\u043a\u0438 10 \u043d\u0430 10 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0441\u0442\u0440\u0430\u0439\u0434\u0430\u043c\u0438, \u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0432\u0451\u0440\u0442\u043a\u043e\u0439 \u0438 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u043a\u043e\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b 40 \u0441\u043b\u043e\u0451\u0432 \u0441\u0432\u0451\u0440\u0442\u043a\u0438 3 \u043d\u0430 3 \u0441 Gated Linear Unit, \u0442\u043e \u0435\u0441\u0442\u044c \u0441 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e, \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0443 (\u0432\u0441\u0451, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e), \u0430 \u0442\u0430\u043a\u0436\u0435 Group Normalization:<\/p>\n<pre><code class=\"python\">class GaussianEncoder(Module):     def __init__(self):         super(GaussianEncoder, self).__init__()         self.gn1 = GroupNorm(2, 128)         self.cnn1 = Conv2d(3, 128, kernel_size=(10, 10), stride=(10, 10))         self.cnn = torch.nn.ModuleList()         self.gn = torch.nn.ModuleList()         for i in range(0, 20):             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))             self.gn.append(GroupNorm(2, 128))         self.cnn_out = Conv2d(64, 8, kernel_size=(1, 1))         self.glu = GLU(dim=1)      def forward(self, x):         y = x         y = self.cnn1(y)         y = self.gn1(y)         y = self.glu(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_ = self.gn[i](y_)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g         y = self.cnn_out(y)         return y   class GaussianDecoder(Module):     def __init__(self):         super(GaussianDecoder, self).__init__()         self.cnn_in = Conv2d(8, 128, kernel_size=(1, 1))         self.gn_in = GroupNorm(2, 128)         self.gn = torch.nn.ModuleList()         self.cnn = torch.nn.ModuleList()         self.gn5 = torch.nn.GroupNorm(2, 6)         self.cnn5 = ConvTranspose2d(64, 6, kernel_size=(10, 10), stride=(10, 10))         for i in range(0, 20):             self.gn.append(GroupNorm(2, 128))             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))         self.glu = GLU(dim=1)      def forward(self, x):         y = x         y = self.cnn_in(y)         y = self.gn_in(y)         y = self.glu(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_ = self.gn[i](y_)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g         y = self.cnn5(y)         y = self.gn5(y)         y = self.glu(y)         return y   class GaussianAutoencoder(Module):     def __init__(self):         super(GaussianAutoencoder, self).__init__()         self.encoder = GaussianEncoder()         self.encoder_var = GaussianEncoder()         self.decoder = GaussianDecoder()         self.sigma = torch.nn.Parameter(torch.randn(1))         self.loss_fn = torch.nn.MSELoss(reduction='none')      def forward(self, x):         y = self.encoder(x)         y_var = self.encoder_var(x).sigmoid()         if self.training:             z = torch.distributions.Normal(y, y_var)             norm = Normal(0.0, 1.0)             y = z.rsample()             y = self.decoder(y)             t = Normal(y, (self.sigma.sigmoid() * 2.0 + 1e-6).sqrt())             y = t.rsample()             loss = self.loss_fn(y, x) \/ (2.0 * (self.sigma.sigmoid() * 2.0 + 1e-6))             loss = loss.mean(dim=0).sum() + div(z, norm).mean(dim=0).sum()             loss = loss + (self.sigma.sigmoid() * 2.0 + 1e-6).log() * 360.0 * 640.0 * 3.0 * 0.5             return y, loss         y = self.decoder(y)         return y     def encode(self, x):         y = self.encoder(x)         y_var = self.encoder_var(x).sigmoid()         z = Normal(y, y_var)         y = z.sample()         return y<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 sigma-VAE, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043e\u0431\u0443\u0447\u0430\u044e \u044d\u0442\u043e\u0442 \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0451\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0438 \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451: \u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440, \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u044e &#171;\u0440\u0435\u043a\u043e\u0434\u0435\u0440&#187;, \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434\u0430\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u0441\u043e\u0431\u043e\u0439 feature maps \u0441 8 \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e 36 \u043d\u0430 64 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440 360 \u043d\u0430 640):<\/p>\n<pre><code class=\"python\">def l2norm(x):     y = x * x     y = y.sum(dim=1, keepdim=True).sqrt()     y = x \/ y     return y  class Recoder(Module):     def __init__(self, ):         super(Recoder, self).__init__()         self.cnn_in = Conv2d(8, 64, kernel_size=(1, 1))         self.cnn = torch.nn.ModuleList()         for i in range(0, 20):             self.cnn.append(Conv2d(64, 128, kernel_size=(3, 3), padding=(1, 1)))         self.cnn_out = Conv2d(64, 8, kernel_size=(1, 1))      def forward(self, x, return_h=False):         y = x         h = []         y = self.cnn_in(y)         for i in range(0, 20):             y_ = self.cnn[i](y)             y_, y_g = torch.chunk(y_, 2, dim=1)             y_g = y_g.sigmoid()             y = y_ * (1.0 - y_g) + y * y_g             y = l2norm(y)             h.append(y)         y = self.cnn_out(y)         if return_h:             return y, h         return y<\/code><\/pre>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a h \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c. \u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043a\u043e\u0434\u0435\u0440\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u0438, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0443\u044e \u043e\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438, \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u043c\u043e\u0439 \u0440\u0435\u043a\u043e\u0434\u0435\u0440 \u043a\u0430\u043a \u0431\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0442\u044f\u0433\u043e\u0439 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044e \u0438\u0434\u0435\u0430\u043b\u0443 \u0438 \u0442\u044f\u0433\u043e\u0439 \u043a \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044e:<\/p>\n<pre><code class=\"python\">  def corrloss(y, x):       zx = ((x - x.mean()) ** 2 + 1e-16).sum()       zy = ((y - y.mean()) ** 2 + 1e-16).sum()       z = 1.0 - ((x - x.mean()) * (y - y.mean()) \/ (zx * zy).sqrt()).sum()       r = (zx.log() - zy.log()) ** 2       r = r + (x.mean() - y.mean()) ** 2       return z, r t = float(i % 5300 + 1) \/ 5300.0 s1 = 1.0 - 1.0 \/ (2.0 ** (150.0 * (t - 0.1)) + 1.0) s2 = 1.0 - 1.0 \/ (2.0 ** (150.0 * (0.9 - t)) + 1.0) s_ = 1.0 \/ (1.0 + ((t - 0.9) * 100.0) ** 2.0) s_ = s_ + 1.0 \/ (1.0 + ((t - 0.93) * 100.0) ** 2.0) s_ = s_ + 1.0 \/ (1.0 + ((t - 0.96) * 100.0) ** 2.0) s = ((s1 + s2 - 1.0) * 0.16 + s_ \/ 0.8) y_, h = rec(x1, True) y_ = y_.tanh() * inp_c_max * 1.1 loss1, _ = corrloss(y_, x1) if i % 5300 &lt; 1060:   loss2, r = corrloss(y_, inp_code) else:   loss2, r = corrloss(y_, inp_code2) loss = loss1 * (loss1 - s).detach() loss = loss + loss2 * loss2.detach() * (1.0 - 0.8 * s) + 0.25 * r<\/code><\/pre>\n<p>inp_code \u0438 inp_code2 &#8212; \u044d\u0442\u043e \u043a\u043e\u0434\u044b \u043f\u0435\u0440\u0432\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, s1 \u0438 s2 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 &#171;\u043f\u043b\u0430\u0442\u043e&#187; \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043a\u0438 \u0441 \u043a\u043e\u043b\u043f\u0430\u0447\u043a\u043e\u043c, \u0430 s_ &#8212; \u0437\u0430 \u0435\u0433\u043e \u043a\u0443\u043b\u044c\u043c\u0438\u043d\u0430\u0446\u0438\u044e. \u0422\u0430\u043a\u0436\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u043a\u043e\u0434\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u0435\u0442\u043e\u0434 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"python\">x1 = x1 * 0.5 + 0.5 * y_<\/code><\/pre>\n<p>\u0410 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0438\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">with torch.no_grad(): triangular = (1.0 - (torch.arange(100).float().unsqueeze(0) - 50.0).abs() \/ 50.0) \/ 100.0 inp_code = autenc1.encode(inp) inp_code2 = autenc1.encode(inp2) inp_c_max = max([inp_code.abs().max(), inp_code2.abs().max()]) x1 = torch.randn(inp_code.size()) m = (torch.rand(20) * 36.0).long() n = (torch.rand(20) * 64.0).long() q = (torch.rand(20) * 16.0).long() p = (torch.rand(20) * 20.0).long()<\/code><\/pre>\n<p>triangular, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, &#8212; \u044d\u0442\u043e \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u043a\u0442\u0440\u0430 &#171;\u044d\u043d\u0446\u0435\u0444\u0430\u043b\u043e\u0433\u0440\u0430\u043c\u043c\u044b&#187; \u0440\u0435\u043a\u043e\u0434\u0435\u0440\u0430, \u0430 \u0441\u0430\u043c\u0430 \u0436\u0435 &#171;\u042d\u042d\u0413&#187; \u043d\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0432\u0441\u0451 \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"python\">  from PIL import Image    from matplotlib import pyplot   from scipy.fft import dct      h_var = [1.0] * 100   h_mu = [0.0] * 100  with torch.no_grad(): h1_ = [] for j in range(0, 20): h_ = (h[p[j]][:, q[j], m[j], n[j]] - h_mu[j]) \/ h_var[j] ** 0.5 h_mu[j] = h_mu[j] * 0.99 + h[p[j]][:, q[j], m[j], n[j]] * 0.01 h_var[j] = h_var[j] * 0.9 + 0.1 * (h[p[j]][:, q[j], m[j], n[j]] - h_mu[j]) ** 2 h1_.append(h_.unsqueeze(0))  h1_ = torch.cat(h1_, dim=0) h1.append(h1_) if (i + 1) % 1000 == 0: h1 = torch.cat(h1, dim=1).numpy() h1_ = torch.from_numpy(dct(h1, type=2, axis=1)) h1_ = 0.5 * (h1_ ** 2).log() h2 = [] for j in range(0, 900): h2.append((h1_[:, j:(j + 100)] * triangular).sum(dim=-1, keepdim=True)) h2 = torch.cat(h2, dim=1) for j in range(0, 20): fig = pyplot.figure(i \/\/ 1000 + 1) pyplot.plot(h2[j]) s_name = \".\/encephalograms_log_spectrae\/\" s_name = s_name + format(j + 1) s_name = s_name + \"\/pic_\" + format(p[j]) s_name = s_name + \"_\" + format(q[j]) s_name = s_name + \"_\" + format(m[j]) s_name = s_name + \"_\" + format(n[j]) s_name = s_name + \"_\" + format(i \/\/ 1000 + 1) s_name = s_name + \".jpg\" pyplot.savefig(s_name) pyplot.close(fig) fig = pyplot.figure(i \/\/ 1000 + 1, figsize=(20, 6), dpi=120) pyplot.plot(h1[j]) s_name = \".\/encephalograms\/\" s_name = s_name + format(j + 1) s_name = s_name + \"\/pic_\" + format(p[j]) s_name = s_name + \"_\" + format(q[j]) s_name = s_name + \"_\" + format(m[j]) s_name = s_name + \"_\" + format(n[j]) s_name = s_name + \"_\" + format(i \/\/ 1000 + 1) s_name = s_name + \".jpg\" pyplot.savefig(s_name) pyplot.close(fig) h1 = []<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043e\u0434, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043a\u0438 \u0441 \u043a\u043e\u043b\u043f\u0430\u0447\u043a\u043e\u043c, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62172f5f10d5580b3c67a13a\" data-style=\"\" id=\"62172f5f10d5580b3c67a13a\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u0437\u0434\u0435\u0441\u044c \u0441 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c\u0438 \u042d\u042d\u0413\u0448\u0435\u043a \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<p><a href=\"https:\/\/disk.yandex.ru\/d\/SOmVw9MYM9Cv8Q\" rel=\"noopener noreferrer nofollow\">https:\/\/disk.yandex.ru\/d\/SOmVw9MYM9Cv8Q<\/a><\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0442\u0440\u0435\u043d\u0438\u0440\u0443\u0435\u043c VAE \u0432 train.py, \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0432 test.py, \u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0451 \u0432 source_maker.py, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439.<\/p>\n<p>\u0412\u043e\u0442, \u043a\u0441\u0442\u0430\u0442\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u042d\u042d\u0413 \u0441\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u043e\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/653237\/\"><\/a><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-330055","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330055"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330055\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}