Related

How to set the horizontal (or vertical) axis number format for a Google Sheets chart?

I'm generating a spreadsheet, several pivot tables, and charts to visualize the results. I have everything working, except I haven't found a way to set the number format for the chart horizontal/vertical axes. I want the axes to show whole numbers, without the need for me to change the number format of the backing data.
Unfortunately, the documentation provided by Google does not cover this feature: https://developers.google.com/apps-script/chart-configuration-options#line-chart-configuration-options.
It is possible to set the number format manually, however, as I'm generating a large number of charts, it would be too burdensome to do this for all charts.
Here is an example of the Apps Script code used to generate my charts:
embeddedChartBuilder.setChartType(Charts.ChartType.LINE)
.setPosition(chartRow, chartColumn, 0, 0)
.setNumHeaders(1)
.setOption('backgroundColor', '#222222')
.setOption('height', chartHeightPx)
.setOption('width', chartWidthPx)
.setOption('series', [
{color:'#4ebcbb', pointSize:6, lineWidth:4},
{color:'#cccccc', pointSize:6, lineWidth:4},
{color:'#666666', pointSize:6, lineWidth:4},
{color:'#34a853', pointSize:6, lineWidth:4}])
.setOption('applyAggregateData', 0)
.setOption('vAxis.gridlines.color', '#434343')
.setOption('vAxis.minValue', 0)
.setOption('vAxis.maxValue', 5)
.setOption('vAxis.textStyle', { color: '#efefef', fontName: 'Arial', fontSize: 12, bold: false, italic: false })
.setOption('hAxis.textStyle', { color: '#efefef', fontName: 'Arial', fontSize: 12, bold: false, italic: false });
On the Line Chart page under Configuration Options you have the hAxis.format with the following description:
A format string for numeric or date axis labels.
For number axis labels, this is a subset of the decimal formatting ICU pattern set . For instance, {format:'#,###%'} will display values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5. You can also supply any of the following:
{format: 'none'}: displays numbers with no formatting (e.g., 8000000)
{format: 'decimal'}: displays numbers with thousands separators (e.g., 8,000,000)
{format: 'scientific'}: displays numbers in scientific notation (e.g., 8e6)
{format: 'currency'}: displays numbers in the local currency (e.g., $8,000,000.00)
{format: 'percent'}: displays numbers as percentages (e.g., 800,000,000%)
{format: 'short'}: displays abbreviated numbers (e.g., 8M)
{format: 'long'}: displays numbers as full words (e.g., 8 million)
For date axis labels, this is a subset of the date formatting ICU pattern set . For instance, {format:'MMM d, y'} will display the value "Jul 1, 2011" for the date of July first in 2011.
The actual formatting applied to the label is derived from the locale the API has been loaded with. For more details, see loading charts with a specific locale .
In computing tick values and gridlines, several alternative combinations of all the relevant gridline options will be considered and alternatives will be rejected if the formatted tick labels would be duplicated or overlap. So you can specify format:"#" if you want to only show integer tick values, but be aware that if no alternative satisfies this condition, no gridlines or ticks will be shown.
This option is only supported for a continuous axis.
Type: string
Default: auto
And also a vAxis.format option with the following formats:
A format string for numeric axis labels. This is a subset of the ICU pattern set . For instance, {format:'#,###%'} will display values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5. You can also supply any of the following:
{format: 'none'}: displays numbers with no formatting (e.g., 8000000)
{format: 'decimal'}: displays numbers with thousands separators (e.g., 8,000,000)
{format: 'scientific'}: displays numbers in scientific notation (e.g., 8e6)
{format: 'currency'}: displays numbers in the local currency (e.g., $8,000,000.00)
{format: 'percent'}: displays numbers as percentages (e.g., 800,000,000%)
{format: 'short'}: displays abbreviated numbers (e.g., 8M)
{format: 'long'}: displays numbers as full words (e.g., 8 million)
The actual formatting applied to the label is derived from the locale the API has been loaded with. For more details, see loading charts with a specific locale .
In computing tick values and gridlines, several alternative combinations of all the relevant gridline options will be considered and alternatives will be rejected if the formatted tick labels would be duplicated or overlap. So you can specify format:"#" if you want to only show integer tick values, but be aware that if no alternative satisfies this condition, no gridlines or ticks will be shown.
Type: string
Default: auto

How to translate the text in Vega

I would like when I use text in Vega it is internationalized.
for example :
legend: {
....
labelExpr: "datum.value == 'TIME' ? i18next.t('LATE') : i18next.t('TIME')"
}
in this example internationalization does not work.
Is there a solution to be able to translate easily in Vega ?
Vega expressions cannot be arbitrary javascript; the functionality available is listed here: https://vega.github.io/vega/docs/expressions/
Translation is not among the available functionality. The best way to do this is probably to pre-populate a translated column in the dataset before passing it to the vega specification.

How to visualize 3d joints of a SMPL model based on pose params

I am trying to use demo.py in nkolot
/
GraphCMR | GitHub. I am interested in obtaining joints from the inferred SMPL image and visualize it similar to described in README of this project: gulvarol
/
smplpytorch | GitHub.
I also posted the issue here: https://github.com/nkolot/GraphCMR/issues/36.
What I tried that didn't work.
I changed https://github.com/nkolot/GraphCMR/blob/4e57dca4e9da305df99383ea6312e2b3de78c321/demo.py#L118 to
pred_vertices, pred_vertices_smpl, pred_camera, smpl_pose, smpl_shape = model(...) to get smpl_pose (of shape torch.Size([1, 24, 3, 3])). Then I just flattened it by doing smpl_pose.cpu().data.numpy()[:, :, :, -1].flatten('C').reshape(1, -1) and used the resulting (1, 72) pose params as input in pose_params variable of smplpytorch demo.
The resulting visualization doesn't look correct to me. Is this the right approach? Perhaps there is an easier way to do what I am doing.
How to get 3d joints from demo.py and visualize it | nkolot
/
GraphCMR
The problem is that
smpl_pose (of shape torch.Size([1, 24, 3, 3]))
is the SMPL pose parameters expressed as a rotation matrix.
You need to make a transformation from rotation matrix to axis-angle representation which is (72,1). You can use Rodrigues formula to do it, as claimed in the paper:
Get more information from the paper:
SMPL: A Skinned Multi-Person Linear Model

decompose text into multi-class

am looking for a machine learning algorithm which serves as String decoder (Multi-label classifier).
for example , decompose an email xyz#qwe.abc.com into different classes with/out probability
xyz:owner
#:special_character
qwe:sub-domain
abc.domain
or 231115
23:hour
11:minute
15:seconds
my case is more complex, but the above would guide me where to look.
for example I might have
74als353d
74:family
als:ftype
353d:id
and
73das
7:family
as:ftype
3d:id
I came across deep learning alogirthm SEQ2SEQ would be a good starting point ?

Custom mesh jittering in Mujoco environment in OpenAI gym

I've tried modifying the FetchPickAndPlace-v1 OpenAI environment to replace the cube with a pair of scissors. Everything works perfectly except for the fact that my custom mesh seems to jitter a few millimeters in and out of the table every few time steps. I've included a picture mid-jitter below:
As you can see, the scissors are caught mid-way through the surface of the table. How can I prevent this? All I've done is switch out the code for the cube in pick_and_place.xml with the asset related to the scissor mesh. Here's the code of interest:
<body name="object0" pos="0.0 0.0 0.0">
<joint name="object0:joint" type="free" damping="0.01"></joint>
<geom size="0.025 0.025 0.025" mesh="tool0:scissors" condim="3" name="object0" material="tool_mat" class="tool0:matte" mass="2"></geom>
<site name="object0" pos="0 0 0" size="0.02 0.02 0.02" rgba="1 0 0 1" type="sphere"></site>
</body>
I've tried playing around with the coordinates of the position and geometry but to no avail. Any tips? Replacing mesh="tool0:scissors" with type="box" gets rid of the problem entirely but I'm back to square one.
As suggested by Emo Todorov in the MuJoCo forums:
Replace the ground box with a plane and
use MuJoCo 2.0. The latest version of the collision detector
generates multiple contacts between a mesh and a plane, which
results in more stable simulation. But this only works for
plane-mesh, not for box-mesh.
The better solution is to break the mesh into several meshes, and include them as multiple geoms in the same body. Then MuJoCo will construct the convex hull of each sub-mesh, resulting in multiple contact points (even without the special plane mechanism mentioned above) and furthermore it will be a better approximation to the actual object geometry.