In the name of God
This gist contains steps to setup Ubuntu 22.04
for deep learning.
https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52
В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам
''' | |
Generic object to dict converter. Recursively convert. | |
Useful for testing and asserting objects with expectation. | |
''' | |
def todict(obj, classkey=None): | |
if isinstance(obj, dict): | |
data = {} | |
for (k, v) in obj.items(): | |
data[k] = todict(v, classkey) |
class NeuMF(torch.nn.Module): | |
def __init__(self, config): | |
super(NeuMF, self).__init__() | |
#mf part | |
self.embedding_user_mf = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mf) | |
self.embedding_item_mf = torch.nn.Embedding(num_embeddings=self.num_items, embedding_dim=self.latent_dim_mf) | |
#mlp part | |
self.embedding_user_mlp = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mlp) |
location = /gotoapp { | |
if ($http_user_agent ~* "iphone|ipod|ipad|appletv") { | |
return 301 https://www.apple.com/lae/ios/app-store/; | |
} | |
if ($http_user_agent ~* "android") { | |
return 301 https://play.google.com/store; | |
} | |
if ($http_user_agent ~* "Windows") { | |
return 301 https://www.microsoft.com/store/apps?rtc=1; |
#!/usr/bin/env ruby | |
require 'open3' | |
require 'fileutils' | |
def run_command(command) | |
puts("+: " + command) | |
Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread| | |
Thread.new do | |
stdout_stderr.each {|l| puts l } |