Comments (2)
@sz144 #53 has been merged into the master. Could you please take a look at this issue on MMD? Thanks.
from pykale.
In this DAN example, we use an unbiased estimation of MMD with linear complexity following the original paper. It may be the reason.
Refer to Xlearn, the complete version should be
def DAN(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None):
batch_size = int(source.size()[0])
kernels = guassian_kernel(source, target,
kernel_mul=kernel_mul, kernel_num=kernel_num, fix_sigma=fix_sigma)
loss1 = 0
for s1 in range(batch_size):
for s2 in range(s1+1, batch_size):
t1, t2 = s1+batch_size, s2+batch_size
loss1 += kernels[s1, s2] + kernels[t1, t2]
loss1 = loss1 / float(batch_size * (batch_size - 1) / 2)
loss2 = 0
for s1 in range(batch_size):
for s2 in range(batch_size):
t1, t2 = s1+batch_size, s2+batch_size
loss2 -= kernels[s1, t2] + kernels[s2, t1]
loss2 = loss2 / float(batch_size * batch_size)
return loss1 + loss2
from pykale.
Related Issues (20)
- PyTorch 2.0 HOT 1
- [Bug] Error raised by version mismatch between PyTorch and Lightning while running tutorial HOT 2
- [Bug] Error raised rdkit from kale\prepdata\chem_transform.py on windows, python 3.10 (with ubuntu no error)
- [Bug] Error raised by 'np.float' which was a deprecated alias for the builtin 'float'.
- Merging all the cnn modules such as seq_nn.py, attention_cnn.py into one cnn.py module
- Refactor QBin to be one level up from Pykale repo, under the pykale umbrella HOT 2
- [Refactor] Considering the incorporation of the OneHotEncoder from scikit-learn into PyKale HOT 3
- [Refactor] Merge all evaluation metrics into one module HOT 3
- [Feature Request] Consider input parameter validation in PyKale
- [Refactor] Merge modules `losses`, `distance`, and `metrics` to one HOT 8
- Changelog workflow runs failed
- Support to load parameters from a saved checkpoint HOT 1
- Quantile Binning Refactor HOT 7
- [Refactor] Let one config file contain all hyperparameters. HOT 3
- [Bug] Testing data is downloaded into different directory paths
- [Feature Request] Optimizing functional test time with pytest-testmon HOT 1
- Incorrect loss and accuracy found in the digit_dann example
- [Refactor] GitHub actions caching HOT 1
- Module visibility issues
- [Refactor] Modifying add_protonet PR to align with the demo data download separation. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pykale.