Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd November 2018, 20:10 | #101 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
I can't get it to work, I have the same problem.
Code:
source=DGSource("test.dgi",fulldepth=true) b = -0.6 # optimize b = _n_ | -1..1 | b c = 0.3 # optimize c = _n_ | -1..1 | c filtered=BicubicResize(source, 1920, 800, b=b, c=c).Lanczos4Resize(3840, 1600) EDIT: changing to "b = 0.6 # optimize b = _n_ | -1..1 | b" got past the error.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... Last edited by Boulder; 3rd November 2018 at 20:28. |
3rd November 2018, 23:09 | #102 | Link | |
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
Also note that floats are not supported, so with range -1..1 the optimizer will only try values -1, 0 and 1. You can get around this limitation by using something like this: Code:
c = 30/100.0 # optimize c = _n_ | -100..100 | c |
|
3rd November 2018, 23:50 | #103 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
I got it to run with this script, but the iterations all have the same SSIM value. If I open the script in VirtualDub2 and run it, the perFrameResults.txt is there but it is not produced when the script is run with optimizer.bat. I'm using the latest Avisynth+ build with your special plugins in x86 mode. If I run in x64 mode, I get the error message "java.lang.NumberFormatException: For input string: "I don't know what 'ssim' means." even though the plugins are in place and I have both environments of Avisynth+ installed.
Code:
source=DGSource("test.dgi",fulldepth=true) b = 33/100 # optimize b = _n_/100 | -100..100 | b c = 33/100 # optimize c = _n_/100 | -100..100 | c denoised=BicubicResize(source, 1920, 800, b=b, c=c).Lanczos4Resize(3840, 1600) # cut out the part used in quality / speed evaluation source = source.Trim(MIDDLE_FRAME - TEST_FRAMES/2 + (TEST_FRAMES%2==0?1:0), MIDDLE_FRAME + TEST_FRAMES/2) denoised = denoised.Trim(MIDDLE_FRAME - TEST_FRAMES/2 + (TEST_FRAMES%2==0?1:0), MIDDLE_FRAME + TEST_FRAMES/2) last = denoised global total = 0.0 global ssim_total = 0.0 FrameEvaluate(last, """ global ssim = SSIM_FRAME(source, denoised) global ssim = (ssim == 1.0 ? 0.0 : ssim) global ssim_total = ssim_total + ssim """) # measure runtime, plugin writes the value to global avstimer variable global avstimer = 0.0 AvsTimer(frames=1, type=0, total=false, name="Optimizer") # per frame logging (ssim, time) delimiter = "; " resultFile = "perFrameResults.txt" # output out1="ssim: MAX(float)" out2="time: MIN(time) ms" file="perFrameResults.txt" WriteFile(resultFile, "current_frame", "delimiter", "ssim", "delimiter", "avstimer") # write "stop" at the last frame to tell the optimizer that the script has finished frame_count = FrameCount() WriteFileIf(resultFile, "current_frame == frame_count-1", """ "stop " """, "ssim_total", append=true) return last
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
4th November 2018, 01:40 | #104 | Link | ||
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
Quote:
I haven't tested x64 version myself so this could be a bug. Did you set the x64 mode with "-arch x64"? |
||
4th November 2018, 01:50 | #105 | Link | ||
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Quote:
Quote:
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
||
4th November 2018, 03:13 | #106 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
AvisynthOptimizer v0.9.9-beta released.
This version adds a new optimizer argument -initial. It's meant for setting the initial population and the choices are:
NOTE: -initial only works with the algorithm SPEA2 for now, I will add the support for the rest in the next version. Also some much needed bug fixes: -can now read and understand a negative value as the variable's original value in the script (thanks Seedmanc and Boulder for the report) -optimizer will now stop when all parameter combinations have been tested. The population size will be set to number of combinations if it is larger than that (in order to avoid duplicate parameters). Thanks ChaosKing for the report. -duplicate parameter combinations are no longer possible in the initial population (also thanks to ChaosKing for the report) |
5th November 2018, 01:51 | #107 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
AvisynthOptimizer-0.9.10-beta released.
The -initial argument now works with the algorithms NSGA-II and mutation as well. Some more bug fixes: the input script argument without any path component now works (thanks Seedmanc for the bug report). Also the wildcard didn't work with the -initial argument but does work now. |
7th November 2018, 11:40 | #108 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
If you still plan to add VS support someday, there is a new filter now which can calculate a VMAF, PSNR, SSIM and MS-SSIM score (https://github.com/HomeOfVapourSynth...pourSynth-VMAF)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
7th November 2018, 14:03 | #109 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
It would be really nice, high bitdepth support is already a big plus and also those other scores could be useful.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
7th November 2018, 17:07 | #110 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Running this kind of downsizing test with only one frame will hit the "DUPLICATE PARAMS" phase quite soon after the process starts. It seems to try the same values over and over again. Setting sensitivity to false helps a bit but the safest way is to sample multiple frames which will then increase the runtime quite a lot.
In this case, I used -1000..1000 as the range, normally I would go for -100..100 but it has the same problem. Code:
TEST_FRAMES = 1 # how many frames are tested MIDDLE_FRAME = 0 # middle frame number source=FFVideoSource("c:\avisynthoptimizer\churchill.avi",colorspace="yv12") b = 330/1000.0 # optimize b = _n_/1000.0 | -1000..1000 | b c = 330/1000.0 # optimize c = _n_/1000.0 | -1000..1000 | c denoised=BicubicResize(source, 1280, 536, b=b, c=c).LanczosResize(1920, 800) Code:
c selected for mutation b selected for mutation mutated c with 38.399986267089844, value 610 -> 609 mutated b with 38.399986267089844, value -149 -> -148 param values after resolve: b -148 c 609 DUPLICATE PARAMS -148 609 change counts: b 13c 19 b selected for mutation c selected for mutation mutated b with 38.399986267089844, value -149 -> -149 mutated c with 38.399986267089844, value 610 -> 610 param values after resolve: b -149 c 610 DUPLICATE PARAMS -149 610 change counts: b 13c 19 c selected for mutation b selected for mutation mutated c with 38.399986267089844, value 610 -> 610 mutated b with 38.399986267089844, value -149 -> -149 param values after resolve: b -149 c 610 DUPLICATE PARAMS -149 610 change counts: b 13c 19 b selected for mutation c selected for mutation mutated b with 38.399986267089844, value -149 -> -150 mutated c with 38.399986267089844, value 610 -> 609 param values after resolve: b -150 c 609 DUPLICATE PARAMS -150 609
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
7th November 2018, 18:07 | #112 | Link | |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Quote:
Code:
Mutating 1 params by 30,0 % mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2 mutation failed 1000 times, increasing mutation count to 2
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
|
8th November 2018, 00:40 | #113 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
AvisynthOptimizer v0.9.11-beta released.
This version mainly fixes bugs and makes some minor improvements. So there was a bug in the JMetal metaheuristics library which I found and fixed, it affected SPEA2 algorithm's "archive truncation". There is a chance that SPEA2 will give better results after this fix, I haven't done a proper test yet to confirm. Boulder reported a bug which made the sensitivity estimation go haywire, it happened when two consecutive population generations had the exact same runtimes. That one is fixed as well. Also there were too many "mutation failed 1000 times..." log messages so I removed those. The situation is normal when almost all combinations have been tried already. Series results count was sometimes reported as zero when autorefreshing chart started reading the log file at the same time, thanks for ChaosKing for the logs. I made a text change to make it a bit clearer what the best and worst results are about: "Best result" -> "Best run", "Worst result" -> "Worst run". By comparing the best and worst you can determine how reliably the runs achieve a similar result. Finally, the optimizer will stop running if it's unable to change parameter's value in the script (earlier it caused an error message in an infinite loop). |
8th November 2018, 00:44 | #114 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
@Boulder, can you try the latest version and report if it fixes all your issues? You should now be able to use 100.0 as the divider as well.
When I tried your script I had to change MIDDLE_FRAME to 1 in order to get clip length of one frame. With zero it returned the whole clip. Does it work differently for you? |
12th November 2018, 18:24 | #115 | Link | ||
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Quote:
Quote:
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
||
12th November 2018, 21:06 | #116 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Gah, the issue appeared again quite close to the end. I set only -iters 100000 to test. At least it didn't happen right away like it did in the earlier version.
Code:
change counts: b 17c 17 b selected for mutation c selected for mutation mutated b with 1.463081955909729, value -68 -> 10 mutated c with 1.463081955909729, value 34 -> 100 param values after resolve: b 10 c 100 DUPLICATE PARAMS 10 100 change counts: b 17c 17 b selected for mutation c selected for mutation mutated b with 1.463081955909729, value -68 -> -13 mutated c with 1.463081955909729, value 34 -> -79 param values after resolve: b -13 c -79 DUPLICATE PARAMS -13 -79 change counts: b 17c 17 c selected for mutation b selected for mutation mutated c with 1.463081955909729, value 34 -> 100 mutated b with 1.463081955909729, value -68 -> 74 param values after resolve: b 74 c 100 DUPLICATE PARAMS 74 100 change counts: b 17c 17 c selected for mutation b selected for mutation mutated c with 1.463081955909729, value 34 -> 100 mutated b with 1.463081955909729, value -68 -> -30 param values after resolve: b -30 c 100
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
16th November 2018, 00:37 | #117 | Link | ||
Registered User
Join Date: Sep 2010
Location: Russia
Posts: 85
|
I'm trying to add MRecalculate to optimization with the following (partial) script:
Quote:
Quote:
|
||
17th November 2018, 00:58 | #118 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
AvisynthOptimizer v0.9.12-beta released.
Some minor bug fixes and improvements:
|
17th November 2018, 01:27 | #119 | Link | |
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
The second problem is that the filter rejects all the values when doRecalc==false, therefore the conflict resolvation cannot finish (it expects to find some combination of parameters which are valid). How to fix this? You have to return at least one valid value for every parameter. Using variable RblockSize as an example, the filter could be like this: Code:
filter:doRecalc x 16 ? x == If the parameter already has a filter, you can add min or max definition (easier to separate the logic than try to make one more complex filter). Min: Code:
min:doRecalc 4 64 ? Code:
max:doRecalc 64 4 ? So it's a bit of work to add all these min/max/filter definitions, I will have to think if there's an easier way to support this kind of disabling of parametes. Another way is to make a separate script for the MRecalculate-version. Optimize both scripts and see which one gave better results. I tried this and to my surprise the script without MRecalculate was better. I think it might be because there are much more parameters to optimize in the MRecalculate-script and therefore the search doesn't get anywhere close to optimal results in the same iteration count. |
|
18th November 2018, 19:43 | #120 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
I got this one with the latest version. It happened quite close to the end (once again those resizing tests of mine) and seems to happen with every run. I fired up five concurrent optimizations and three have now failed with the error around the ~39000th iteration.
Code:
java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Unknown Source) at avisynthoptimizer.AviSynthOptimizer.selectRandomWeightedByChangeCount(AviSynthOptimizer.java:2493) at avisynthoptimizer.AviSynthOptimizer.mutateResult(AviSynthOptimizer.java:5049) at avisynthoptimizer.nsga_ii.RangeMutation.execute(RangeMutation.java:93) at avisynthoptimizer.nsga_ii.RangeMutation.execute(RangeMutation.java:25) at avisynthoptimizer.spea2.DynamicSPEA2.reproduction(DynamicSPEA2.java:103) at org.uma.jmetal.algorithm.impl.AbstractEvolutionaryAlgorithm.run(AbstractEvolutionaryAlgorithm.java:60) at java.lang.Thread.run(Unknown Source)
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
Thread Tools | Search this Thread |
Display Modes | |
|
|