Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boolean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
verimag
tempo
boolean
Commits
b26eb898
Commit
b26eb898
authored
6 years ago
by
Nicolas Basset
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
2b2538dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
simple_run2.py
+34
-0
34 additions, 0 deletions
simple_run2.py
with
34 additions
and
0 deletions
simple_run2.py
0 → 100644
+
34
−
0
View file @
b26eb898
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 26 17:03:02 2018
@author: elefther
"""
import
booleans
as
bl
n
=
10
# dimension of the cube = number of variables
## Define a random DNF that has 10 terms, each of them with 10 stars
## find a sample of size 100
from
fixed_input_big
import
S
#S = bl.sample_from_DNF_u(10,*DNF) # better method for large n
print
'
traning sample |S| =
'
,
len
(
S
),
'
defined
'
print
S
T
=
bl
.
Table
(
S
)
T
.
learn_kDNF
(
50
,
print_on
=
False
,
print_latex
=
False
)
#for i in xrange(len(S)-1):
# j = len(T.partitions)
# print 'joins=%d cost=%d size = (%d,%d,%d) error=%.4f' %(row['number of merges'],row['total_cost'],row['size'],row['min_order'],row['max_order'],row['error1'])
# print T
# T.step('f')
#
#print T
res
=
'
\n\n
'
.
join
(
T
.
terms
)
#res= '================================'+ '\n'.join(T.terms)+'\n================================'
f
=
open
(
'
result50
'
,
'
w
'
)
f
.
write
(
res
)
# python will convert \n to os.linesep
f
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment