Comments (9)
You are right, that would be a nice enhancement. It would be quite easy if we changed the interface of loss
to also contain x
. Then you could store the weighting factor in x
and use that in the loss.
from pystruct.
Yep, I'm adding x argument to all loss() functions all over the code right now.
from pystruct.
Cool. Do you think it is feasible to do this in a backward-compatible way?
I think I would add it as a last and optional argument for the models, so that they would also work with learners that don't do it. But I don't see an easy way to make the new learners work with models that don't take an x
.
from pystruct.
I don't know how to add weights to all models without going through all the code, so I'll probably only add support for weights to EdgeFeatureGraphCRF (since I'm currently only interested in it). I'm thinking to just check the length of x tuple to decide if the weights are given and the loss should be weighted.
from pystruct.
I would rather create a new model that inherits from EdgeFeatureGraphCRF
which always wants weighted nodes. If that is too complicated, I'd at least add a boolean parameter.
If you inherit and create a new model, you only have to write a new loss
and overwrite the function that checks x
to be in the correct format.
from pystruct.
+1 for boolean parameter that can be checked if loss is weighted.
On Oct 26, 2013 7:33 PM, "Andreas Mueller" [email protected] wrote:
I would rather create a new model that inherits from EdgeFeatureGraphCRFwhich always wants weighted nodes. If that is too complicated, I'd at least
add a boolean parameter.
If you inherit and create a new model, you only have to write a new lossand overwrite the function that checks
x to be in the correct format.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/94#issuecomment-27158238
.
from pystruct.
Ideally, this should be implemented in a way that also includes the class_weight
option. That is currently hacked in a bit. Maybe the class_weight should be implemented in terms of instance weights?
from pystruct.
Yeah, class_weight seems redundant when nodes can have weights, but still more convenient. EdgeFeatureGraphCRF could translate class weights to node weights so that lower levels don't have know about class weights.
from pystruct.
exactly :)
from pystruct.
Related Issues (20)
- Label dependent features
- can be graph with edges be analysed like it is done by networkx? HOT 2
- Why i ran example code in my pc it gives error like 'float' object cannot be interpreted as an integer HOT 2
- wrong `n_latent` in `EdgeFeatureLatentNodeCRF` with `latent_node_features=True` HOT 2
- OS X Mojave version 10.14.2 couldn't install pystruct on python 3.7.2 HOT 10
- Importing `numpy` during setup causes install issues
- Unstable test causing CI build failures: test_one_slack_ssvm.test_one_slack_constraint_caching
- knn crf / svm crf HOT 1
- ChainCRF , NSlackSSVM - Tuple index out of range HOT 3
- VOC example edge features
- Identification of support vectors?
- needed algorithm description for perceptron algorithm
- crf.state_features_ method for linear chain crf
- error on installing on Linux HOT 2
- error on databricks install (7.2 (includes Apache Spark 3.0.0, Scala 2.12))
- GraphCRF - error in edge list example, very long training gprocess
- Installation Failed on Google Collab and Kaggle Notebook HOT 3
- SSVM for Clustering
- use_2to3 is invalid HOT 1
- About the version with a faster inference speed
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 pystruct.