I'm trying to use cross-validation in Tensor-flow . i write this semi code as my algorithm
Database{
Class1=12000
Class2=20000
}
TrainBatch=
{
Class1=11000
Class2=18000
}
TestBatch=
{
Class1=1000
Class2=2000
}
epoch=5000
while(Epoch>0)
{
K=10
Shufle(TrainBatch);
Devide TrainBatch To 10 Batch For Cross Validation;
for (i=1;i=k;i++)
{
V=Fetch (ValidateBatch[i]);
T=Fetch (TrainBatch-V);
Y=TrainWithTensorflow(T);
Validate(Y,V);
SaveDetail();
}
Epoch--;
}
Final Test(Class1=1000,Class2=2000);
but i don't know how to combine Cross-validation and tensor-flow training parameters in one algorithm.
is method is correct ? or
can anyone correct this method ?
Related
I have been working on NLP project and Now I need to create Speech-to-text model for that
but my dataset is noisy and I have to create the noise reduction to train my Speech-to-text model
my go is to change some of this items
optimization = {
'amplify': '2.2 dB',
'bass': '9.0 dB',
'treble': '-1.0 dB',
'volume': '1.0 dB',
'speed': '0.98',
'high-pass': {
'frequency': '1000 Hz',
'roll-off': '6dB per octave',
},
'low-pass': {
'frequency': '1000 Hz',
'roll-off': '6dB per octave',
},
'snap-to': 'nearest',
'quality': 'insane-320 kbps',
'variable-speed': 'standard',
'chanel-mode': 'joint-stereo',
'rate': '16000 HZ',
}
so what should I learn first
I have tried applying a filter in Sensu, from referring Sensu document, for reducing our monitoring alerts. But problem is, this filter is sending email only when issue is in Resolved state, no critical or warning alerts. Filter looks like :
{
"filters": {
"state_change_only": {
"negate": false,
"attributes": {
"occurrences": "eval: value == 1 || ':::action:::' == 'resolve'"
}
}
}
}
Please help me in understanding this behaviour and what this eval: value == 1 actually means here.
Does it have to do anything with occurrences value? I have values like 2,3 etc. depending on the severity of the checks.
I get different results when using a model to get image annotation predictions from web UI and from API. Specifically, using the web UI I actually get predictions, but using the API I get nothing - just empty output.
It's this one that gives nothing using the API: https://cloud.google.com/vision/automl/docs/predict#automl-nl-example-cli
Specifically, the return value is {} - an empty JS object. So, the call goes through just fine, there's just no output.
Any hints as to how to debug the issue?
By default only results with prediction score > 0.5 are returned by the API.
To get all predictions you will need to provide extra argument 'score_threshold' to predict request:
For the REST API:
{
"payload": {
"image": {
"imageBytes": "YOUR_IMAGE_BYTES"
},
"params": { "score_threshold": "0.0" },
}
}
For the python call:
payload = {'image': {'image_bytes': content }, "params": { "score_threshold": "0.0" }}
With this argument all predictions will be returned. The predictions will be ordered by the 'score'.
Hope that helps,
That doesn't work, at least at the moment.
Instead the params need to go at the same level as the payload. E.g.:
{
"payload": {
"image": {
"imageBytes": "YOUR_IMAGE_BYTES"
}
},
"params": { "score_threshold": "0.0" },
}
Is there any alternative method to minimise line of code.
this.addRoeForm.controls.supplierName.setValidators(Validators.required);
this.addRoeForm.controls.fromCurrency.setValidators(Validators.required);
this.addRoeForm.controls.toCurrency.setValidators(Validators.required);
this.addRoeForm.controls.roe.setValidators(Validators.required);
Object.keys(this.addRoeForm.controls).forEach(key => {
this.addRoeForm.get(key).setValidators([Validators.required]);
});
I am having several experiments a day storing the error of the experiment and a boolean value (if the result is ok) in elasticsearch.
Now, I would like to display the results in a graph (using highchart js).
I use an aggregation query like this to receive the aggregated errors for each day including the standard deviation:
query: {
filtered: {
filter: {
range : {
date: {
"gte":"2015-1-1",
"lte": "2016-1-1,
"time_zone": "+1:00"
}
}
}
}
},
// Aggregate on the results
aggs: {
group_by_date: {
terms:{
field:"date",
order: {_term:"asc"}
},
aggs:{
error_stats:{
extended_stats:{
field:"error"
}
}
}
}
}
The problem I face is that I cannot retrieve the boolean values the same way as I get the double errors from the DB.
When I just change the field name to "ok" in
aggs:{
error_stats:{
extended_stats:{
field:"ok"
}
}
}
I receive this error message:
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
However, it would be OK to aggreate all the boolean values usign true as 1 and false as zero and then to receive a mean value for each day.
Can anyone help me with this?
Thanks alot!
First 0/1 representation is not exactly ES Boolean representation. There is a Boolean type for as true/false.
Second stats aggregation can be only done on numeric field and not on string field.
That is why it worked for 0/1 representation.
You can transform this value using scripts in extended stats
{
"aggs" : {
...
"aggs" : {
"grades_stats" : {
"extended_stats" : {
"field" : "grade",
"script" : "_value == 'T' ? 1 : 0",
}
}
}
}
}
To see some example usage of scripting in aggregation , you can look here.