一系列常用模型的Keras实现
Multilayer Perceptron (MLP) for multi-class softmax classification
from keras.models import Sequential
# Obtain the label of a given class (:class1). | |
SELECT DISTINCT ?c (STR(?l) AS ?lb) | |
WHERE { | |
?c a :class1 ; | |
<http://www.w3.org/2000/01/rdf-schema#label> ?l . | |
} | |
# Obtain a list of classes. | |
SELECT DISTINCT ?c | |
WHERE { |
import numpy as np | |
from scipy.sparse import csr_matrix | |
import torch | |
__author__ = 'Andrea Esuli' | |
Acsr = csr_matrix([[1, 2, 0], [0, 0, 3], [4, 0, 5]]) | |
print('Acsr',Acsr) | |
Acoo = Acsr.tocoo() |
import torch | |
from torch import LongTensor | |
from torch.nn import Embedding, LSTM | |
from torch.autograd import Variable | |
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium'] | |
# | |
# Step 1: Construct Vocabulary | |
# Step 2: Load indexed data (list of instances, where each instance is list of character indices) |
by Danny Quah, Jan 2022
This gist describes using Obsidian on iPad while syncing to other Obsidian platforms. The procedure uses git
in iSH
on iOS
, and thus differs from using either Obsidian Sync
or Working Copy
as described in Obsidian/iOS+app.
(To be clear, Obsidian
is one of my favourite Apps, and I'm all for supporting the team financially. Moreover, everything I've heard suggests the paid Obsidian Sync
is excellent. However, I don't want my syncing processes to proliferate --- each service using a different client sync flow --- so I keep my systems minimal: just syncthing
and git
. After writing this I found an Obsidian Forum writeup which uses the same tools I do to achieve the same goal, but you'll want to read that with its accumulated contributions dispersed across the comments. So at least I was thinking
if (window.location.origin !== "https://www.instagram.com") { | |
window.alert( | |
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.", | |
); | |
window.location.href = "https://www.instagram.com"; | |
console.clear(); | |
} | |
const fetchOptions = { | |
credentials: "include", |